Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Quick question about tags and OnTriggerExit()

Discussion in 'Physics' started by ChardBurger, Dec 6, 2018.

  1. ChardBurger

    ChardBurger

    Joined:
    Oct 16, 2018
    Posts:
    4
    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:
    899
    You do get a Collider object, just do a collider.gameObject.tag or collider.gameObject.CompareTag.