There is an unsaved comment in progress. You will lose your changes if you continue. Are you sure you want to reopen the work item?
Setting Body.Enabled=false in OnCollision not supported
I could be doing something wrong, but this causes problems for Farseer. What I'm seeing is that Contact.FixtureA and/or Contact.FixtureB are set to null whilst it's in the middle of iterating and calling the OnCollision handlers (causing null reference exception).
For me it occurs when a bullet hits an enemy and both need to disable their physics at that time, which seems like a common use case. I know I could set a flag to disable the body in the next frame, but I'd rather not.
I've "fixed" it for now by adding Body.Enabled checks in ContactManager.Collide and FixtureA and FixtureB != null checks in Contact.Update(). Perhaps there is a better way though?