Hello to all.
In my character I have the First Person Controller. I want the character to get up in the air going up on the Y axis Now everything works ok thanks alo script Aldonaletto below.
The problem lies in the fact that the character salt, but can not get it right and to the left of it seems to be locked. I tried to change all the values but nothing. I ask for a help from someone more experienced maybe Aldonaletto by itself. How could I go up and then move to the right and left forever in flight?
Thank you.
var cMotor: CharacterMotor; // reference to the CharacterMotor script
function Start(){ // get the CharacterMotor script at Start:
cMotor = GetComponent(CharacterMotor);
}
function Update(){ // move player upwards while F is pressed
if (Input.GetKey("f")){
cMotor.SetVelocity(Vector3.up*1.5);
}
}
// This do-nothing function is included just to avoid error messages
// because SetVelocity tries to call it
function OnExternalVelocity(){
}