i've got a Sensor for a Fish. If Someone Collides with the Sensor the Fish try to swim away.
if the Player is out of the Sensor the Fish should swim his normal random way.
Set OnSensorCollision returns true; the On Seperation Event works but the Fish did't change his direction if you follow him in his Sensor
Set OnSensorCollision returns false; the On Seperation Event don't works but the Fish change his direction if you follow him in his Sensor.
I need a contineous Detection with a Seperation Event
Sensor.OnCollision += OnSensorCollision;
Sensor.OnSeparation += OnSensorSeperation;
bool OnSensorCollision(Fixture A, Fixture B,Contact contact)
movementPattern = MovementPattern.Scared;
TargetDirection = A.Body.Position - B.Body.Position;
void OnSensorSeperation(Fixture fixtureA, Fixture fixtureB)
movementPattern = MovementPattern.RandomSwim;