Hey all. I have decided i wanted to learn some Unity editor extension scripting and iv been learning for about 1 week now. Im trying to create a script that deletes a gameobject in the scene i use Destroy(gameobject) that is called with a editor extension button how ever i keep getting an error saying that i need to use DestroyImmidiatly and set it to true. How ever when i do that it removes the prefab not the object in the scene. All i want is for the button to delete the game object in the scene with out needing to play the game to delete it.
Are you sure you’re not taking the prefab as ‘gameobject’ variable to Destroy()?
When I was making something similar, I used Destroy(gameObject) but had to receive the gameObject from the hierarchy menu.