Hi. I’m new to unity and don’t know much of javascript right now . Anyways in my learning project I’m trying to make weapon pickups
. So I have my RocketLauncher as a child of Main Camera and a rocketlauncherpickup object which is just a mesh with a box collider (Trigger - true ) and this script attached to it :
function Start() {
var realLauncher = GameObject.Find("RocketLauncher");
realLauncher.SetActiveRecursively(false);
}
function OnTriggerEnter ( other : Collider) {
realLauncher.SetActiveRecursively(true);
Destroy(gameObject);
}
When I run it it gives me: Unknown identifier: ‘realLauncher’.
I dont know what to do :? Can someone help me solve this problem?