here is an image ( I cant post )show what I am gonna to do in my XNA game , I want to check if the player is inside zone range and if yes then attack the player , I tried to do this using checking ray but it's odd and give null results as player must be in front of enemy so he can be detected ! ![enter image description here][1]
if (enemyRay.Intersects(cci.CharacterController.Body.CollisionInformation.BoundingBox) <= 200)
{
RunController(dwarfAnimatior, dwarfwalk);
dwarfChrachterController.Body.ApplyImpulse(dwarfChrachterController.Body.OrientationMatrix.Forward,
Vector3.Normalize(enemyRay.Direction) * 50.0f);
if (enemyRay.Intersects(cci.CharacterController.Body.CollisionInformation.BoundingBox) <= 50)
{
sound.playAh();
}
}