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

How to use a tag in children of an gameobject?

$
0
0
Hello all, I have a change-able character (a game object as a parent and there are 2 characters as child in it) (as an example you can assume a human can turn to a werewolf) Now I can access to the parent`s tag easily and enemies work well. But what if I want a special enemy be able to attack to the tag "Human" only? (parent has a "Player" tag and child has "Human" and " Werewolf" tag) By changing the tag for enemy to follow then it is not work. (means in codes instead of using "Player" tag using "Human" or "Werewolf" which are child) So how can I use a tag in children? I am appreciate for any help. void OnTriggerStay2D(Collider2D other) { if(other.tag=="Player" && ...)

Viewing all articles
Browse latest Browse all 120

Trending Articles



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