- Home /
Gravity on a rotating platform
I'm trying to make it so that a platform can rotate freely in three dimensions and that the players gravity when standing on it is down relative to the platform (if the platform is upside down, the player's gravity is world up). But when the platform is rotating, the gravity is not straight down.
Right now, I'm using
rigidbody.addForce(platform.transform.InverseTransformDirection(Vector3.down));
Is there a way to account for the rotation when calculating which way down is?
Answer by aldonaletto · Nov 03, 2013 at 03:42 AM
Take a look at this: it's a script that generates a local gravity pointing down the surface the character is - maybe it solves your problem.
Your answer
Follow this Question
Related Questions
How can I rotate and move a cylindrical rod from one side with respect to other side? 1 Answer
Returning a rigidbody back to its original x and z rotations through physics forces. 2 Answers
Stop velocity on rotation change 2 Answers
How best to control rigidbody rotation within constraints 0 Answers
How to make a object jump constantly at y and move to the next position to z (perfectly) 0 Answers