This project has moved and is read-only. For the latest updates, please go here.

Sensor OnCollision Static Geom

Topics: User Forum
Jan 25, 2010 at 12:39 PM
Edited Jan 27, 2010 at 5:40 PM

Edit: Deleted old threat, I got it working.

New problem however. I created a small body/geom below my character in order to check when he separates and collides with the ground. I did this by creating a Geom which IsSensor. And then I update it's position every update, relative to the player's position. Then I add these lines:

GeomSensor.OnCollision += OnCollision;
GeomSensor.OnSeparation += OnSeparation;

private bool OnCollision(Geom g1, Geom g2, ContactList contactList)

return true;

private void OnSeparation(Geom g1, Geom g2)


There's obviously some code there, but that's not important. The problem is that the OnCollision never runs when the other Geom is Static, in this case the ground, which obviously should be static.

Is it like this, isn't it possible for a Sensor to detect static geometry?


Edit: Well, I found the answer to my question. Apparently two Static geometries can't call the "OnCollision" event. The feet of the character is a circle which isn't static, I guess I can use that one to check for collisions instead of a sensor. But how do I check if the collision was in the lower part of the circle?