ColliderCast vs Trigger

I have portals and wanna know if someone stepped into. Would it be more performant to use triggers and just loop over all the in-game triggers and cherry-pick the portal ones, or should I use zero-distance ColliderCast per portal?

I'd go for trigger, implement ITriggerEventsJob and filter out those you are not interested in early. Also, with latest samples code, you can look at DynamicBufferTriggerEventAuthoring, which gives you two things - trigger events on an entity you are interested in (so you don't need to filter it), as well as stateful events with Enter/Stay/Exit info.

1 Like

Thank you very much!

1 Like