Hello, i’m very new at Unity scripting so any help on this subject would be much appreciated.
I am having trouble to make a gravity system for my next game. I want to make a gravity pull that affects the first person controler so that the player model can jump from one gravity axis to another and still be turning upwards in relative to the cube.
In short, i am trying to make local gravity fields on cubes that enables the player to change gravity axis.
I don’t know if it’s just a simple scipt or if it’s much more complicated, i just can’t figure it out.
Have you tried setting Physics.gravity http://unity3d.com/Documentation/ScriptReference/Physics-gravity.html? You could use triggers or another technique to determine when you want to change the gravity.
Yes i tryed using a forcefield with zero gravity but the problem is the first person controller. I have tryed to apply a rigedbody to it, and turning of gravity to both the body and the controller, but it just starts spinning uncontrolable without being pulled in the right direction.
So basically i need a way to affect the FPS controller in a controllable direction.
did you freeze the rigid body’s rotation?