Hi guys,
I have really small players (animated sprites basically).
I added 50 by 50px rectangle as a shape to that animated sprite in order to achieve reliable touch detection.
Problem is that touch stays the same as before (with no shape added).
When touching shape nothing happens…
What am I doing wrong (below code shows no errors)?
local myShape = { -50, -50, 50, 50, 50, -50, -50, 50, isSensor = true} physics.addBody ( player, "dynamic", {shape = myShape, density=1, friction=0, bounce=0, filter = {categoryBits = 4, maskBits = 1}})
function playerTouch(self, event) if(self.removeSelf == nil) then return elseif( event.phase == "began" and gameIsActive == true ) then ---- CODE end end
Many thanks!
Ivan 