Bug with Region Collision Check

Weasel8778

  • Posts: 236
I have a region which is a small rectangle on the stage (it works as a checkpoint). I use:

always:
if('Player' is inside 'Checkpoint Region')
print (x of 'Player')

And usually, it works. When I enter the region, the console gets spammed with my current x position. Then when I leave the region, it stops. However, occasionally I can 'escape' from the region and the spam continues. I can run around any part of the scene, clearly way outside of the region and the console is still telling me my x position. Apparently, it still thinks I'm inside the region.

It's easy to recreate the issue. If I stand at the very point where the region starts and tap the left key to move out of the region, it often assumes I'm still in it. If not, I just tap right again to re-enter, then tap left again to retry. Before long, I have the bug where the game thinks I'm in the region when in fact I can move anywhere I like.

Unfortunately, my game cannot function correctly without resolving this issue as it is obviously crucial for the game to know if I am inside the checkpoint region or not.

UPDATE: Enabling continuous collision detection did not solve the problem.

UPDATE: In case this helps; once the bug has started, if I then go back into the region and leave again, the bug stops (unless, by chance, it happened again).

UPDATE: While the bug still exists, it's no longer crucial for me to fix this since I've made changes to the game so that at the moment, it doesn't matter. It'd still be nice to find out what the bug was though.

« Last Edit: July 04, 2011, 06:43:51 am by Weasel8778 »

Hectate

  • *
  • Posts: 4643
Is your region a polygon, possibly concave (even slightly)?
:
:
Patience is a Virtue,
But Haste is my Life.
Proud member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.

Weasel8778

  • Posts: 236
Is your region a polygon, possibly concave (even slightly)?

I used the basic rectangle tool to draw the region so I guess... no?

Hectate

  • *
  • Posts: 4643
No then. I had a similar sounding issue with concave collision shapes, but a rectangle would not have the same issue as mine - even if the symptoms are similar.
:
:
Patience is a Virtue,
But Haste is my Life.
Proud member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.