RPG Camera Movement

Hi everyone! I have been playing with Corona for a little over two months. I am having an issue I think you all might be able to help me with.

What’s working:

When I touch anywhere on my screen/level map my character goes there and my camera updates.

– This is how I am adjusting my group (levelMap) relative to player X
local function moveCam ()
if(player.x < 80 and player.x < 1024)
levelMap.x = -player.x + 80)
end
end
What DOES NOT work:

I have walls/barriers things the player should not be able to go through or over. How can I prevent the player from going through these barriers when I touch a point that has a barrier in between the player and where I’ve touched.

Bothe the player and the barriers have physics bodies on them. the player has “dynamic” and the barriers/walls have “static”

Think of you basic RPG (i.e) Final Fantasy III (The original) Thanks for any help [import]uid: 53149 topic_id: 9955 reply_id: 309955[/import]

That should work. Turn on the physics debug drawing mode. So something like this
physics = require(“physics”)
physics.start()
physics.setDrawMode( “hybrid” )

That will show you both the object and its physical model. You might have the model a bit off… [import]uid: 8673 topic_id: 9955 reply_id: 36293[/import]

@mhorsley That is a great idea for debugging! I can see that both objects wall and player have physics applied and the phys box is wrapped around them pretty good. [import]uid: 53149 topic_id: 9955 reply_id: 36295[/import]