Is it possible to somehow set a “no gravity” mode to the first person controller?
To get a airplane/fly simulation camera?
Im still new to unity, so this might be a very simple thing, but i cant find it so far.
thanx!
Is it possible to somehow set a “no gravity” mode to the first person controller?
To get a airplane/fly simulation camera?
Im still new to unity, so this might be a very simple thing, but i cant find it so far.
thanx!
If you’re using the First Person Controller that comes with Unity, you must modify the variable movement.gravity inside CharacterMotor.js (the script that controls the character movement). Place this code in a script attached to the character, and you can set the gravity value calling the function ChangeGravity(g):
function ChangeGravity(g: float){
var chMotor: CharacterMotor = GetComponent(CharacterMotor);
chMotor.movement.gravity = g;
}
If you want to start the game with a lunar gravity, for instance:
function Start(){
ChangeGravity(1.6); // set a lunar gravity at start
}
The standard value is 10.0; if you set to 0.0, you will have no gravity at all.
I have a script that I came across, I changed a couple of things but it works and allows me to go up and down with no problems. The camera follows but I am still having trouble smoothing it out… Hit me up on Skype if you want to take a look at it… My Skype username is Lightning4771 upon add request tell me why your adding me… ![]()