Physics question
-
- Prole
- Posts: 6
- Joined: Mon Sep 03, 2012 12:34 pm
Physics question
I need to create a body, which reacting with another body. I need this body to behave like it is background (another bodies should pass through this body), but I also need body to trigger callback functions. Can I do this?
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: Physics question
Yes. Simplest way is using Fixture:setSensor(true). The "background object" won't collide with anything, but it will throw callbacks.
A more complex way to do it would be with Fixture:setFilterData. With that function you can make the background body collide with some objects but not with others, make groups, etc.
A more complex way to do it would be with Fixture:setFilterData. With that function you can make the background body collide with some objects but not with others, make groups, etc.
When I write def I mean function.
-
- Prole
- Posts: 6
- Joined: Mon Sep 03, 2012 12:34 pm
Re: Physics question
Yes, it it exactly what I want! Thanks a lot!
Who is online
Users browsing this forum: Ahrefs [Bot], Majestic-12 [Bot] and 7 guests