Quantcast
Channel: Questions in topic: "tagging"
Viewing all articles
Browse latest Browse all 120

Tag an gameobject at runtime after a condition completed

$
0
0
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"; }

Viewing all articles
Browse latest Browse all 120

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>