Sensors and collisions

Aug 26, 2011 at 1:56 PM

Hi guys,

I've got a couple of problems I was wondering if anyone could help me.

Firstly, I've got a locator, which is a sensor that tracks if anything is sitting on top of it (so it can't spawn another bad guy) but when my bullets or player touch it they have a small bump into it, as if they've initially collided with it. The locator is a sensor, and while collides with the player it doesn't collide with the bullet. And neither the player nor the bullet collide with it. I was wondering if anyone knows what could be causing this bump? I know it happens because my bullet is designed to disappear whenever it hits anything, and it's hitting the locator. I'm using an oncollision event for the locator, not sure if that's got anything to do with it.


 bool SensorTouched(FarseerPhysics.Dynamics.Fixture fixtureA, FarseerPhysics.Dynamics.Fixture fixtureB, FarseerPhysics.Dynamics.Contacts.Contact contact)
            return true;

My second problem is that when one of my bad guys die, if it was touching a door sensor (which works in the same way, monitors how many things have touched it and if it's over 1, it remains open) the door remains open. Is there any way to manually disconnect two touching objects before I disable them? I don't want to constantly destroy and remake my bad guys, so I have a stock of them and just move them to spawn locations and activate them when they come back into the game.


Thanks for any help.