- Home /
destroy doesn't remove the graphics
I'm using this script to remove a GameObject:
if(Other.gameObject.name == "knife"){
if(Input.GetButtonDown("interact")){
knife=true;
Destroy (Other);
}
}
}
the code does work, and it seems the collider of the knife does disappear, and the boolean variable "knife" does become true. but the graphics of the knife stays in the game and this is a problem for me.
how do I make the graphics disappear as well?
Comment
Best Answer
Answer by CHPedersen · Aug 24, 2013 at 12:25 PM
Destroy the gameobject instead of just the collider:
Destroy(Other.gameObject);