How do I rotate my feet to gravity
I'm making a space game and I'm using this code for gravity to my planet. public GameObject attractedTo; public float strengthOfAttraction = 5.0f;
void FixedUpdate ()
{
Vector3 direction = attractedTo.transform.position - transform.position;
transform.position += direction * strengthOfAttraction * Time.deltaTime;
}
How can I make my characters feets always face down, to the planet?
I've tried with .lookAt();
and transform.rotation
Comment
Your answer
Follow this Question
Related Questions
Having trouble rotating around transform.up 0 Answers
How can I bind this script into the state of my camera? 2 Answers
After added a rigidbody in a GameObject, it moves on rotation 2 Answers
Rotate a game scene preserving all physics ,Rotate scene preserving all game structure (physics) 1 Answer
How to create "Gravity Roads" in a FPS? 3 Answers