Destroy Object

Hello guys, i have a kinda weird problem. I have an item (wizard stuff). Its a cylinder that contains a ball which contains a fire particle effect. On the cylinder i have a sphere trigger collider. So when the player goes through the item i want it to be destroyed and its id to go to the player id array so i know what items he has. As a little trick i use col.gameObject.tag.Length to see if the tag has 5 chars. (only the items has 5 char tags). So if the tag has 5 chars i destroy it Destroy(col.gameObject) where col is the items collider. Nothing happens. Its also strange that i have a script on the stuff that says to rotate so it looks more “alive” → transform.Rotate(0, 10, 0). This doesnt work eather. what can i do?

Don’t call destroy on the component object, call it on the game object the component is attached to instead, so Destroy(collider.gameobject) or something.

Can you post a copy of your script? Are you sure that the script is attached to the object in question?

Ok guys i fixed it. There was a problem with a command that was running before Destroy() and blocked it :slight_smile: