- Home /
Re-orienting Player after changing direction of Gravity
Hi all,
So I'm making a simple puzzler where you change the direction of gravity to solve the puzzles, this is done using triggers and the " Physics.gravity = new Vector3(0, -1.0F, 0);" command.
Problem is the player is a rigidbody controlled by adding force to the horizontal and vertical axes, making it uncontrollable once the gravity changes. I can't for the life of me figure out how to make these axes (and the camera orientation for that matter) change when the gravity changes.
I tried moving the script from the objects that trigger the change, onto the player character itself (I thought this would be smarter as I could use one script for all gravity changes rather than one on every object) and then use tags (e.g. North/East/South/West/Up/Down) to ensure the gravity shifted in the right direction, but that seems to stop it from working completely, i suspect I'm doing the collisions wrong but I'm not sure...
I wondered if anyone here has attempted something similar? Any tips or hints would be great! Thanks!
Your answer
Follow this Question
Related Questions
Player in Spaceship 2 Answers
Changing gravity on collision 4 Answers
How to make telephone wires 1 Answer
My objects keep falling through 1 Answer
Game Scaling Best Practice 0 Answers