This is the testing Godot forums! All forum posts unique to this forum will be deleted! Please use the main forums here for any posts you want to keep. All forum rules still apply.

how to use move_and_slide on a rotating platform?

icqqqicqqq Posts: 36Member
edited February 2018 in 3D

I want to achieve a character can follow a rotating platform to move.
However I found move_and_slide do the job but is not perfect.
Somehow when time moves, the position of kinematic character will shift.

So how to solve it?

My code in kinematic body:

vel = Vector3()
func _physics_process(delta):
vel.y += g*delta
vel = move_and_slide(vel, Vector3(0, 1, 0))

My rotating platform is a rigidbody in kinematic mode and rotated by animation player

Thanks!

please find my project in the link:
https://drive.google.com/file/d/19mSzlSlZkkp7AuoEKnE0yudV5-kn47r8/view?usp=sharing

Best Answer

  • MegalomaniakMegalomaniak Posts: 2,580
    edited February 2018 Accepted Answer

    I mean if you place something on top of a rotating object such as a turn table it experiences centripetal acceleration(because friction).


    @icqqq said:

    However, the body will shift and finally move out of the platform.

    So in other words add/raise friction, also might help to lower objects pivot point or whatever determines the center of mass. Also, raise mass or gravity. Plenty of ways to cheat against physics in a game engine.

Answers

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.