OnCollide / OnSeperation event bug

Sep 13, 2011 at 11:40 AM

for my platformer i have a int that stores how much contacts the player wheel haves, but if farseer "fails" for some seconds and bodys get stuck in each other, the counter of my platformer wheel goes up and up and never gets back to 0 if the bug is solved (even if the wheel is not touching the buged bodys)

this is very bad because if that happens the player can fly around because my code thinks he is still on ground.

is there a way to fix it? i'm using FPE 3.2

Feb 23, 2012 at 10:37 PM

I found that OnSeperation events are only fired for the last body that I registered a listener with. I posted a similar discussion topic about EndContact, which behaves the same way. I have 4 objects that the player ball can go through, and with each i register BeginContact / EndContact and OnCollision / OnSeperation delegates. The BeginContact and OnCollision events occur correctly but the other methods that I register as delegates for OnSeperation and EndContact are only called when the ball leaves contact with the last object I had registered for those events. The funny thing is it will go into the method i register for each object (i see this in the debugger) but it only fires the event for that last object registered.


very weird.