playMaker

Author Topic: Moving a 2D trigger around causes OnTriggerEnter2D flooding  (Read 1904 times)

purbanics

  • Junior Playmaker
  • **
  • Posts: 55
Moving a 2D trigger around causes OnTriggerEnter2D flooding
« on: April 25, 2014, 02:23:26 AM »
Hi,

Please check this and explain why this is like it is and if this is a bug or not.

Make a "big" trigger with an FSM that does nothing simply waits for
TRIGGER ENTER 2D
TRIGGER STAY 2D
TRIGGER EXIT 2D
Custom global events.

Have a "small" object inside it that causes these to trigger.

Now while the game is running move the trigger around just slightly so the "small" triggering object stays inside the trigger and observe the log that it is flooded with OnTriggerEnter2D events.
I think it should only contain OnTriggerStay2D events because the triggering object has never left the area of the trigger.
Also when moving the trigger away from the triggering object no OnTriggerExit2D event happens.

If I let go of the trigger and move the object around everything works as expected: there is an ENTER when it enters, continous STAY while in the area of the trigger and one EXIT when moved away.

Why is this?
Are you not allowed to move triggers? :o

Br,
Peter