This project has moved. For the latest updates, please go here.

How to check, if an object has collided with anything?

Mar 26, 2011 at 1:11 PM
Edited Mar 26, 2011 at 1:31 PM


I'm trying to implement a simple jumping mechanism by setting _isJumped = true (now you can't jump anymore), and as soon as a collision occurs (with the ground or another object) _isJumped = false.

I understand that Fixture has a method OnCollision() that can check if any two objects have collided, which would do the trick, but I don't want to iterate over all objects in the game. (note: I'm not sure that I really understand how OnCollision works, so this might be a really naive question :-) )

Is there a more elegant way to check for collisions?


 Solved, I thought, that I would have to call the OnCollision() function by myself.   C# noob pitfall ;-)