Ugly FP3 gotcha: don't set Position before CollisionGroup

Topics: Developer Forum, User Forum
May 4, 2010 at 12:45 AM

Thought I might be able to save someone some time that I spent (about two and a half hours of it):

When you set a body's position, FP3 will generate contacts for it. If you set CollisionGroup after that, the contacts' validity doesn't get re-evaluated: i.e., the contacts stay there even though the CollisionGroup says there should be no contacts.

In my case, I was creating bodies for a rope at the same position as the player's avatar. I was setting the position and rotation first, then the CollisionGroup. After many hours of bashing my head against the keyboard trying and carefully setting breakpoints to work out what was causing this weird behaviour (rope colliding with the player even though the CollisionGroups were the same; rope reacting to the player's rotation when it was being reeled out, etc. etc.) I realised that I was setting Position before CollisionGroup, and setting Position was generating the contacts.


Could we please either re-check contact validity before we solve the contact or not generate contacts on SetTransform (but instead during the world step?)