Omit physics bodies from events.

How would I go about omitting certain objects from event listeners?

Here is what I am doing. I have 3 objects in my world, I have a sound event so when they collide they play a sound. I also have 4 walls that contain these objects. How do I make it so when these objects collide with the wall the sound event is not triggered? Only when they collide with eachother.

Thanks! [import]uid: 20431 topic_id: 5527 reply_id: 305527[/import]

give your object a type eg

[lua]wall1.class=“wall”
wall2.class=“wall”
ball1.class=“ball”
ball2.class=“ball”[/lua]

(you can call the variable whatever you want)

then in your collision check eg

[lua]local obj1 = event.object
local obj2 = event.other
if(obj1.class==“ball” and obj2.class==“ball”) then
myPlaySoundFunction()
end[/lua]
[import]uid: 6645 topic_id: 5527 reply_id: 18856[/import]