- Home /
Access Physics manager settings through script
Hi
I'm currently trying to dynamically change the gravity in my scene. I noticed the gravity xyz settings in the physics manager, I can access it ingame through the inspector, but is there a way to access the variables via script?
Comment
Answer by SarperS · Mar 26, 2011 at 06:38 PM
Sure, Physics.Gravity(X, Y, Z).
In Unity 5, above didn't but this syntax worked for me:
Physics.gravity = new Vector3(0f, 5f, 0f);
Your answer
Follow this Question
Related Questions
Movement on a tube 1 Answer
Rigidbody ball physics 1 Answer
Object affected by gravity freezes after it comes to rest 1 Answer
Need help on my script to calculate gravity for a mass 1 Answer
shrinking according to mass 0 Answers