- Home /
GUI not showing up on player destroy
GUI code works fine when tested, but when the player dies, it doesn't shows up i used void OnDestroy() { transform.parent.gameObject.AddComponent (); }
Answer by Trevdevs · Jun 28, 2018 at 08:02 PM
https://docs.unity3d.com/ScriptReference/GameObject.AddComponent.html
Your not adding any component .AddComponent takes a type
tried it it didn't work transform.parent.gameObject. AddComponent();
Does it give any kind of error? it could be 2 things as far as i can see
there is no parent
You're destroying the wrong object
Your answer
Follow this Question
Related Questions
Game Over GUI 2 Answers
Taking a hit 3 Answers
Problem| Player Name Above The Player 2 Answers
How do I stop an immediate collision with all objects from ocuring at the entry of game mode? 0 Answers
How to make a monolgue? 1 Answer