Hi everybody,
I have a 3D game. In the Hierarchy there is a GameObject that has a component “GUIText”. GUIText is visible by the camera and has some “Example Text”. I need to change the Gui Text via Healscript when enemy is destroyed. In the HealthScript I have this condition which defines destroying the Enemy:
if (hp <= 0)
{
Destroy(gameObject);
}
Can somebody help me, please? I created a public variable but I am not able to assign the Gui Text because it is in that GameObject. I probably need to use GameObject.Find but can not figure it out.
Thanks.