in my project. i use some tags.
but my new tag is maybe doesn't work.
has some picture
![alt text][1]
red square : '1'
it sprite tag is 'Key'
so, as far as i know if i checked '(Collider2D).gameObject.tag' is 'Key'.
but
![alt text][2]
is return 'untagged'
i don't know why return untagged.
used other tags are work well. just that tag isn't work.
how can i do use tag?
here is my some codes.
----------
void OnTriggerEnter2D (Collider2D other) {
print(other.gameObject.tag);
print(other.gameObject.layer);
if (other.gameObject.tag == "Key")
{...}
}
[1]: /storage/temp/98635-사용자-지정-1.png
[2]: /storage/temp/98636-사용자-지정-2.png
↧