VisualStudio kept telling me that collision.tag == “Package” is inefficient and i should use collision.CompareTag(“Package”);
Not sure if .tag is getting phased out or not. Just thought i’d mention it.
VisualStudio kept telling me that collision.tag == “Package” is inefficient and i should use collision.CompareTag(“Package”);
Not sure if .tag is getting phased out or not. Just thought i’d mention it.
Just decided to look it up myself. It looks like it’s not so much that it’s getting phased out, but more just that due to implementation of CompareTag it results in a bit better performance.
More details can be found on this post: Is CompareTag better than gameObject.tag performance wise? - Unity Answers
It’s not being phased out , just more performant to use .CompareTag (less garbage created by the strings)