i am trying to make a script that deletes the object its attached to when your player touches it but it does nothing here’s my script
*var delslf = false;
var target : Transform;
function OnControllerColliderHit(hit : ControllerColliderHit)
{
if(hit.gameObject.tag == "Player")
{
delslf = true;
}
}
function update ()
{
if (delslf);
Destroy(target);
}*
please help