Hi, I have been making a first person Shooter game. In it the player is supposed to walk over a gun to get it. Here’s the script.
var gun : GameObject;
var armed : GameObject;
var unarmed : GameObject;
function OnTriggerEnter(other : Collider){
if(other.gameObject.tag==“Player”)
Getgun();
}
function Getgun(){
Destroy(gun.gameObject);
armed.active = true;
unarmed.active = false;
}
here as soon as the player collides with the “gun”, the gameobject which looks unarmed is supposed to be replaced by the gameobject which looks armed. However this does not happen and the player just keeps banging onto the gun gameobject.
Thanks in Advanced.