- Home /
onCollision explode and sound help
my helcopter starting is on ground, So cant attach OnCollisionEnter script, So how am i suppose to call it inside the side. Below is a not stable 1, if(helicopter.transform.position.y < 38) then explode. any1 know how to change this to if (OnCollision) then explode. and somehow my audio also not responding.
function Falling(){
rotor_Velocity = 0;
max_Rotor_Velocity =0;
main_Rotor_Active = false;
tail_Rotor_Velocity = 0;
tail_Rotor_Active = false;
landing = false;
reached = false;
if(helicopter.transform.position.y < 38){ //like to chnage onCollision
audio.PlayOneShot(explodesound); //nothings happen
var explosion1 : Transform;
explosion1 = Instantiate(explosion,transform.position,transform.rotation);
}
flightState = 0;
}
Comment