0
function OnTriggerEnter(col : Collider){
if(col.tag == "Player")
{
player.transform.position = SpawnPoint.position;
audio.PlayOneShot(Sound);
VioSign.enabled = true;
if(pauseEnabled == false){
pauseEnabled = true;
AudioListener.volume = 1;
Time.timeScale = 0;
Screen.showCursor = true;
}
}
}
這是我的respawnpoint腳本。如果我回到最後的重生點,我該如何重置我的汽車運動?
#pragma strict
var wheelFL : WheelCollider;
var wheelFR : WheelCollider;
var wheelRL : WheelCollider;
var wheelRR : WheelCollider;
var maxTorque : float = 50;
function Start(){
rigidbody.centerOfMass.y = -0.9;
}
function FixedUpdate() {
wheelRR.motorTorque = maxTorque * Input.GetAxis("Vertical");
wheelRL.motorTorque = maxTorque * Input.GetAxis("Vertical");
wheelFL.steerAngle = 20 * Input.GetAxis("Horizontal");
wheelFR.steerAngle = 20 * Input.GetAxis("Horizontal");
}
這是我的車控制腳本我想再次重生的重生點後,把車停下來。我很難解決這個問題。請幫我:)
多久做ü想停下來的車? – Nick