I have an array of polygonCollisionShapes which are my platforms. I want to make the character fall back to the floor so I go through the array and set their isTrigger to true. This makes the character fall back to the floor. When he hits the floor I try to go back through the array and set isTrigger to false. This causes it to throw "Assertion Failed" in the function b2Assert in b2Settings.as as follows:
Has anyone had this problem or have any ideas what I can try to fix it? I've also tried removing the platforms from the collidesWithTypes and I get the exact same problem when I try to add the platforms back to collidesWithTypes.
*SOLUTION* - I can't edit these properties during the collision. I added a timer that waits 250 ms before trying to change isTrigger and now it works fine.
Code:
static public function b2Assert(a:Boolean) : void
{
if (!a){
//var nullVec:b2Vec2;
//nullVec.x++;
throw "Assertion Failed";
}
}
{
if (!a){
//var nullVec:b2Vec2;
//nullVec.x++;
throw "Assertion Failed";
}
}
Has anyone had this problem or have any ideas what I can try to fix it? I've also tried removing the platforms from the collidesWithTypes and I get the exact same problem when I try to add the platforms back to collidesWithTypes.
*SOLUTION* - I can't edit these properties during the collision. I added a timer that waits 250 ms before trying to change isTrigger and now it works fine.