Я в настоящее время получил мой характер полета в воздухе со следующим сценариемЛетающие характер в единстве 3d
#pragma strict
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*10.5);}
else if (Input.GetKey("up")){
cMotor.SetVelocity(Vector3.forward*10.5);
}
else if (Input.GetKey("left")){
cMotor.SetVelocity(Vector3.left*10.5);
}
else if (Input.GetKey("down")){
cMotor.SetVelocity(Vector3.back*10.5);
}
else if (Input.GetKey("right")){
cMotor.SetVelocity(Vector3.right*10.5);
}
else if (Input.GetKey("g")){
cMotor.SetVelocity(Vector3.down*10.5);
}
}
// This do-nothing function is included just to avoid error messages
// because SetVelocity tries to call it
function OnExternalVelocity(){
}
однако я хочу, чтобы иметь возможность заморозить характер в воздухе, чтобы они не падают, но если я установите maxFallSpeed равным 0, после чего я не смогу снова нарисовать символ. Есть идеи?
Я считаю, что это java-скрипт, стоит добавить этот тег к вашему вопросу. –