It’s my first time using physics and I’m running into an issue.
My app is a top down view of the game map. When the user taps the screen the player object will start moving (via transition.moveTo). I have are invisible display.rect objects scattered throughout the map and when the player object collides with one it automatically changes direction.
So I have the player object setup as a dynamic body
physics.addBody( player, {density=0, friction=0.0, bounce=0.0 } )
and I have the invisible boxes set up as static sensor bodies
physics.addBody( hitBox, static, {isSensor = true} )
From the documentation I thought that when something is made a sensor on the collision effect will trigger, nothing physical. However when my player object collides with the hitBox, the hitBox is moved a few pixels.
I even tested it so the collision function did nothing, and when the player object passed through the hitBox, the hitBox moves a little bit.
Is there any way to stop the hitBox from moving at all?