In my game I have a Body, and on it there can be a variable amount of fixtures. Now I do this to check if it is on the ground!
private void OnCollision(Fixture fix1,Fixture fix2, Contact cont)
Vector2 touchPoint = cont.Manifold.LocalPoint;
Vector2 touchPoint2 = fix1.Body.GetWorldVector(touchPoint);
if (touchPoint2.Y > (_body.WorldCenter.Y))
_onGround = true;
This works to a certain extent, only I want to set the Variable back to false once I stop colliding. That indirectly causes my other problem->
This is when the _onGround is true.
This when it is false.
Currently I am resetting it every Update, that is bad as it causes the variable to "flicker" and is not really a viable solution. This is really blocking me.
Thanks for any help!