Search Unity

  1. Unity 2019.1 is now released.
    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:
    891
    You do get a Collider object, just do a collider.gameObject.tag or collider.gameObject.CompareTag.