Hi, I want to change tag of an gameobject at runtime after a condition completed.
I use:
gameObject.tag = "Myothertag";
but it doesnt work
How I can do fix it?
Thanks,
In this example, my condition works but the tag does not change.
void Update () {
if (distance < 10 && distance > 0 && gameObject.tag == "Player" )
{
GetComponent ().texture = Disparition as MovieTexture;
audio = GetComponent ();
audio.clip = Disparition.audioClip;
Disparition.Play ();
Avertissement.Stop ();
Pose.Stop ();
gameObject.tag = "Quit";
}
↧