0 votes

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.

in Engine by (34 points)

1 Answer

0 votes

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

by (138 points)

Thanks man it's really helpful

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.

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.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.