Why does "istrigger" have to be checked? What if you want to collide with a rigid body, and have it trigger something, bu…

Forum Archive Why does "istrigger" have to be checked? What if you want to collide with a rigid body, and have it trigger something, bu…

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #4794
    andrewm2211
    Participant

      Why does “istrigger” have to be checked?
      What if you want to collide with a rigid body, and have it trigger something, but you still don’t want the player to walk right through it.

      like lets say a wall of spikes that just takes down some health. you want it to be a trigger, but you also don’t want the player to just walk through them.
      Would you just have to have a separate object for the graphics (model of the spikes) and a separate object parented to it to be the trigger?

      #23094
      Jonathan Gonzalez
      Participant

        If you want a collision you’d use “OnCollisionEnter”. It has pretty much the same process as the trigger functions. So you’ll have OnCollisionEnter, OnCollisionStay, OnCollisionExit. That’s for when you want something to hit something but not go through, like maybe a character running into a wall.

        Also to clarify the “isTrigger” checkbox, that tells Unity to treat that collider as a trigger. If you have that unchecked it will still act as a solid collider regardless of whether or not you’re using “OnTriggerEnter”. 

      Viewing 2 posts - 1 through 2 (of 2 total)
      • The topic ‘Why does "istrigger" have to be checked? What if you want to collide with a rigid body, and have it trigger something, bu…’ is closed to new replies.