Question by
Al1aska · Sep 08, 2017 at 04:32 PM ·
gameobjects
Hi, I have some script that is attached to an object so that it isn't destroyed as you play through level 1, level 2, level 3 and so on. However I want this object to be destroyed when the player click the menu screen
void Start () {
Destroy (GameObject.Find("*thegameobjecttobedestroyed*"));
}
} it's no work
Comment
hey dude,use this
public GameObject this;
void Start () {
Destroy (this);
}
:)
Your answer
Follow this Question
Related Questions
checking if gameobject exists 1 Answer
How to Serialize or Save a List of GameObjects 1 Answer
Unnamed gameobjects appear in Unity4 when opening Unity5 project 0 Answers
Set Click area in Game 1 Answer
Destroy gameobjects several times in a scene. Also destroy other instances of that gameobject. 2 Answers