#Sticking Player to Planet
1 messages · Page 1 of 1 (latest)
so basically i have this planet
have this astro guy
trying to make him walk around on the planet simple
so, i got gravity working, but the only problem is it's not "standing" on it, more like just falling over
iirc there is a simple youtube on this
you mean this ?
This video covers how to create custom gravity beyond the default Unity gravity so that developers may implement a gravity force that can pull towards a planet form any direction. The demonstration uses a buggy with an attached Rigidbody component, simple cube collider, and 4 wheel colliders, and a sphere which we set as our source of gravity in...
turn rigidbody rotation constraints you mean?
oh wait, nvm, i did some digging and found some code
i'll try it out and brb
although, I don't completely understand how they made the player "Stand"
You would need to lock rigidbody rotation and update it manually calculating from the center sphere
dont just copy code, cause u missing a script from FauxGravityAttractor
yeye
i see
ya constraints for sure, thats just doing it via code
ehh, you can get a vector by just subtracting position in relation to the sphere and use forward offset to apply it to the character
althouhg, i did a similar thing before using LookAt
ah
aight well ima go have an attempt at that
Many ways to get the rotation
Use Debug.DrawLine or ray to visualize what you get and see how it works
here is what this vidd shows for this movment type https://youtu.be/lPiPeeR5_OA?t=285