Hi! In my game, I have a collision box wrapped around my enemy’s character so that it detects when a player gets near it. I’d like to use the hit events for this, but it doesn’t seem to work. I do have it enabled, as you can see here:
When the player overlaps, however, it does not fire. It has something to do with the collision box, because when I replaced the collision box with a regular mesh box instead, it actually fired.
Any help?
Thank you!
Fixed… It? Apparently it has to block for it to fire. Huh.
when your collision preset is set to “OverlapAll”, nothing will hit it - instead just get trough
For more insight:
As Arty mentioned, the “OnHit” events fire on blocking physics collisions. This requires that the component have Collision Enabled option set to allow Physics Collision (i.e. Physics Only or Collision Enabled) and that the collision responses between the objects is set to Block. Overlaps, though they require physics query to be enabled, are not themselves considered “physics collisions” and thus don’t trigger OnHit Events.