# A Sensor’s ContactList Keeps Old / Ignores New Contacts, When That Contact Is still

Okay this is a hard one to explain so I’ll try my best.

Basically every time my enemy class updates, it runs a SightCone Sensor Contact List test, so this is every single frame it checks for all the possible contacts in it’s sensor.

What I’m finding is that if I’m moving my player character around, the contact list updates perfectly, when the player is in the enemy’s sight, it’s true, when it is out of sight its false,

However if I keep my player still, The contact list always ignores it.

Here is a video showing the behaviour. (the true and false flag is in the top left.)

Here is the code I have. Basically in the Enemy’s update method I run the check (the sightcone is a supplemental body within the enemy class that follows the position and rotation of the enemy body every frame.)

List<Body> coneClip = GetBodiesInContactWithBody(SightCone.Body);

private List<Body> GetBodiesInContactWithBody(Body body)
{
var bodiesInContact = new List<Body>();
var c = body.ContactList;
while (c != null && c.Next != null)
{
if (c.Contact.IsTouching)
{
}
c = c.Next;
}
return bodiesInContact;
}


I am not sure why this is happening. I don’t know why the contact list isn’t seeing the player, even though the body is still, it still exists, has a shape and position, and 100% exists in the physics world.

Truly hope you can help.

• Is the other body asleep? – Andrew Russell Jan 11 '14 at 2:01
• i have no code whatsoever in my solution that would ever put any body created to sleep. unless farseer automatically puts things that are still to sleep without me knowing. – Qas Piano Jan 12 '14 at 13:57
• Update. so i just learnt something new. you are right it was sleeping. didn;t consider it because i though sleeping was a manual thing, not an automatic farseer engine thing. – Qas Piano Jan 12 '14 at 14:03