How do I make my player stick to a moving platform?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Genesis689

How do I make my kinematic body 3d player node stick to a moving static body?
If anyone can help I would be very grateful.

:bust_in_silhouette: Reply From: Blockmaster27

No joke, check out this project. It has exactly what you want. Extremely powerful code here even if it is hard to read. It says it’s for 3.2, but works just fine on 3.5.1. Even if it doesn’t run on the latest version of Godot, you should really try to make it work as you port it over to your project. It will DEFINITELY be worth it, the original author put a lot of effort into this. Great research material, it helped our project too.

When the player enters one of the gravity fields, they are attached and rotated to the floor normal collision, as far as I understand it. I have tested this on moving rigid bodies and static bodies and it works perfectly!

Just be sure to give credits to the original author.

Dynamic Gravity Kinematic Character, by Felipe Moura

Thanks man it’s really helpful

Genesis689 | 2023-01-17 16:42

Nah actually it won’t work in my game as the camera is in a set position and the movement is very, very different. I could probably integrate it but I’m new and I really don’t know how.

Genesis689 | 2023-01-17 17:29

Please dude – keep trying.

You’ll eventually figure out how to port this over if you just keep taking whacks at it. I ported it over to my game too, with an extremely different setup, movement, etc. and entirely in first person rather than third person. Especially look at it for examples on which methods to use and how to use them to get what you want.

All that extra stuff is just fluff. No need to worry about most of it. I’ve deleted about half of the content - not because it’s bad - but because I can’t use it just like you said.

Blockmaster27 | 2023-01-21 21:51