Need help with collision categories

Topics: User Forum
Feb 10, 2013 at 1:34 AM
Hello,

My problem is that i have game objects that i want to be static and not collidable so the other game objects can past through them, but i need collision detection on these objects so i know when the players gameobject is in this zone.

how could i use farseers collision detection this way?

thanks for the help.
Feb 10, 2013 at 1:47 AM
ok so i found out that you can return false in collsion detection to avoid collision also.
        public bool Player_OnCollision(Fixture fixtureA, Fixture fixtureB, FarseerPhysics.Dynamics.Contacts.Contact contact)
        {
            
            if (fixtureB.Body.UserData == "Car")
            {
                Car_Index = fixtureB.Body.BodyId ;
                Is_Touching = true;
                return true;
            }


            if (fixtureB.Body.UserData == "Parking_Space")
            {
                Parking_Space_num = fixtureB.Body.BodyId;
                Console.WriteLine("Parking Space Number = " + Parking_Space_num);
                return false;
            }
            return false;
        }

        public void Player_OnSeparation(Fixture fixtureA, Fixture fixtureB)
        {
            if (fixtureB.Body.UserData == "Car")
            {
                Is_Touching = false;
            }
        }
I love this engine!!!!

i posted this incase someone else has the same problem.