Two parter:
1)
The pinned post in this area says that you should place all your collision filters for all your objects near the top of your main file and later when you add physics bodies to your objects put in the appropriate filter.
Does it have to be at the top of your main?
I’ve seperated my object creation/manipulation for each object into its own file, easier way for me to manage objects.
Where would I put all the filters?
2)
I am trying to make it so that only the player can collide with any obstacle, so no obstacle or collectible, or anything can can collide with each other, only the player.
So are these filters correct?
[lua]
local playerCollisionFilter = { categoryBits = 1, maskBits = 6 }
local obstacleCollisionFilter = { categoryBits = 2, maskBits = 1 }
local collectiblesCollisionFilter = { categoryBits = 4, maskBits = 1 }
[/lua]
For the life of me I can’t get the obstacles and collectibles to NOT collide with each other. This is my code for creating, lets say, one of my obstacles
[lua]
obstacle = createJet(y)
physics.addBody(obstacle, {filter = obstacleCollisionFilter})
[/lua]