- Home /
problem activating an object
Hello. I want to make a king of the hill type area, so that when the player enters that area, their weapons with be active. I attached the to a sphere, with a sphere collider, that is set as a trigger, and yet, when an object with the "Player", enters the circle, the object that I set for the Weapon variable does not activate (I unchecked the weapon before I started the scene, since I only want it to be active when the player is in the circle). What is wrong?
var Weapon : GameObject;
function OnTriggerEnter (other : Collider) { if (other.gameObject.CompareTag ("Player")) Weapon. active = true ; Destroy(gameObject,10); }
Comment