Search Unity

  1. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  2. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  3. Participate with students all over the world and build projects to teach people. Join now!
    Dismiss Notice
  4. Build games and experiences that can load instantly and without install. Explore the Project Tiny Preview today!
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  6. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Quick question about tags and OnTriggerExit()

Discussion in 'Physics' started by ChardBurger, Dec 6, 2018 at 5:29 AM.

  1. ChardBurger

    ChardBurger

    Joined:
    Oct 16, 2018
    Posts:
    2
    Is it possible to refer to tags inside an OnTriggerExit() function? If so, can I see a simple example?
     
  2. PGJ

    PGJ

    Joined:
    Jan 21, 2014
    Posts:
    861
    You do get a Collider object, just do a collider.gameObject.tag or collider.gameObject.CompareTag.