Issues to detect collision between player and walls and make it stop walking.

I’m doing:

for player:

sprite.myName = "player" physics.addBody( sprite, "dynamic", { density=0, friction=0, bounce=0, isSensor=false } )

and the wall (or blocks)

tile.sprite.type = "wall" tile.sprite.myName = "block"physics.addBody( tile.sprite, "static", { density=0, friction=0, bounce=0 } )

and the collision detection routine:

local function onCollision(event)    if event.phase == "began" then        print("COLLISION: obj1: " .. event.object1.myName .. ", obj2: " .. event.object2.myName)        canMove = false        isMoving = false    end end

My game is like a classical top-down view RPG, then the player can move on both x and y: top, down, right, left. I would like to make it behavior like this genre.

It detects collision however the player don’t stop and continue walking along the axis intended.

I don’t understand why I cannot Interact physical object as one being static and other being kinematic. Kinematic should works properly as intended I guess.