Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: SawyerK on November 16, 2022, 10:55:30 AM
-
Hi!
I'm creating some basic trigger mechanic for enemy npcs and I would like to know if there is a better alternative to "On Trigger Enter". There is "On Trigger Stay" but it's just way too performance heavy to use it on a bunch of npcs. "On Trigger Enter" works well but it doesn't trigger if an object is already in the trigger collider so it's not that useful.
Is there a way to make a trigger with like booleans or whatever else like "On Trigger Stay"?
Thank you!
-
Hi.
Overlap actions / cast actions (box cast / sphere cast)
you can find several on the Ecosystem (https://hutonggames.fogbugz.com/default.asp?W1181)
prefer the ones that can set a repeat interval (or loop and use a next frame event advanced), if you don't have to check every frame then you can set a interval like every x frames.
this will increase performance
for example you have 10 trigger checking every frame with a 60 frame per sec.
that would be 600 checks
if you check every 3th frame, this will go down to 200 checks