Trigger "panic"
I have a Trigger component derived from UBoxComponent, and is binding its member functions to the delegates OnComponentBeginOverlap and OnComponentEndOverlap.
So when I step on it, the bound function OnOverlapBegin send a signal to open the door, and OnOverlapEnd send a signal to close it.
It works correctly, but the thing is, if I stand just in the right position at the edge of the trigger, the two functions will alternate rapidly, making the door "panic" and go up and down very fast :S
How do games usually handle this?
My first ideas was: "when the trigger gets overlapped, ignore further signals from the trigger until door is fully open/closed"
...but doesn't seems ideal and responsive, ideally I would just like for the trigger to be precise - if I'm standing still either I'm in or out of it.
So what's the optimal solution to this problem good games employ?
EDIT: Solved! :S
The issue was that the Trigger was attached to the pressure plate, so when you step on it and it sinks into the ground, if you're at the edge the trigger is literally going away from you and ending the overlap, coming back up and creating that flicker effect.
I needed for the Trigger to be a static box not moving with the plate :S