I have a number of "players" in my world, they all react to the world and some of the objects, but i don't want 2 players to react on each other, in other words, if they collide, it should be ignored.
I created this ContactListener that overrides the Add function, but i can't figure out how to ignore the collision between 2 players
The trace is working as it should be, but yeah, they still collide 🙁
I hope somebody can point me in the right direction
I created this ContactListener that overrides the Add function, but i can't figure out how to ignore the collision between 2 players
Code:
override public function Add(point:b2ContactPoint):void
{
if(point.shape1.GetBody().GetUserData() is Player && point.shape2.GetBody().GetUserData() is Player)
{
trace("2 players are colliding");
// ignore collision somehow
}
super.Add(point);
}
{
if(point.shape1.GetBody().GetUserData() is Player && point.shape2.GetBody().GetUserData() is Player)
{
trace("2 players are colliding");
// ignore collision somehow
}
super.Add(point);
}
The trace is working as it should be, but yeah, they still collide 🙁
I hope somebody can point me in the right direction