Hi I have a third person game and I need to have it when a cube gets hit it changes the speed of a helicopter so the player can be transported.
here is the script I made to do so but I get a error that says.
speed is not a member of UnityEngine.Transform
What do I need to do.
this is my script
function OnTriggerEnter( hit : Collider)
{
if(hit.gameObject.tag == "wormProjectile")
{
Destroy(hit.gameObject);
gameObject.Find("helia").transform.speed = 5;
}
}
If you don't have that variable in a script, then I'm not sure what you were expecting it to do. How are you making the helicopter move in the first place? Comment back with your setup if this doesn't solve your problem.