Welcome to the forums @Lualt!
Physics objects will not move and rotate with other objects by default, since their movement is determined by the physics engine rather than the scene transform hierarchy like other Spatial nodes (MeshInstance, etc).
There's a couple ways I can see for handling this right off:
Have the object that is rotating and moving use a StaticBody or RigidBody node and have the collision shape move the player
Pros - easy to setup, no code or workarounds necessary.
Using move_and_slide_with_snap
is helpful for moving with platform velocity with this method, at least that is what I think I remember seeing. I haven't tried move_and_slide_with_snap
in my projects currently.
Cons - less control, can be hard to add mechanics
Have the player check the object it's colliding with and then apply linear and angular velocity based on small changes from frame to frame
Pros - lots of control over how the system works, can selectively enable/disable movement with objects
Cons - harder to setup, can have lots of little quirks, can be complicated to code
The easiest way I have found to do this is have the moving/rotating objects calculate their per-frame difference/delta in position and rotation in their _process
function and then have a raycast that the player uses to get the collider underneath it. Then in the player script you can read these values and apply them to the player's velocity.
That's just a couple ways though, and which method might work better almost certainly depends on your use case and project. Hopefully what I wrote above helps give an idea on a couple ways to achieve what you are looking for. I'd be happy to further explain if needed on either method.
Of the two, I have found the most success with the second method, calculating the delta's in position and rotation on each object and applying it to the player, as I find it offers the most control.
Also:
This discussion was caught in the moderation queue since you have not confirmed your account yet.
Upon creating your account you should have received an account verification email. The confirmation email may have been incorrectly flagged as spam, so please also check your spam filter. Without confirming your account, future posts may also be caught in the moderation queue. You can resend a confirmation email when you log into your account if you cannot find the first verification email.
(Note: You do not need to repost, the discussion has been moved out and is visible now)
If you need any help, please let us know! You can find ways to contact forum staff on the Contact page. Thanks! :smile: