Problem with pattern collision editor

Hello everyone, this is the first time I try to import shapes of objects in Corona SDK, I am using Tile Collision Editor Tool from Tiled Map Editor, but I can’t get it to work. can you help me?

This is the sample code from:

I import the maps like this:

local filename = or "scene / game / map / sandbox.json"
local mapData = json.decodeFile (system.pathForFile (filename, system.ResourceDirectory))
map = (mapData, "scene / game / map")

The monster image imported it like this, but it does not interact with the scene, it falls and is lost:

local physicalData = tiledCollisionEditor.getPhysicalData ("")
-- Create monster image
local monster = display.newImage ("scene / game / map / monster.png", 150, 300)
monster.x = 1200
monster.y = display.screenOriginY + 125

physics.addBody (monster, "dynamic", unpack (physicalData.Objects ["monster.png"]))

Well, hopefully @ldurniat will be available to help you.

In the meantime, did you try to add any physics data manually in Lua and does that have the intended effect? If so, try to look for differences in the physics setup.

Ah, also, since I see you’re using JSON, make sure the plugin supports the JSON format changes released in Tiled 1.2, and if not, enable the json1 plugin instead of the default json plugin in the Preferences, to save to the old format.

Edit: Actually, I just noticed this in the


local physicalData = tiledCollisionEditor.getPhysicalData( '' )

Note: PLugin accept only maps exported to LUA format.

So, try exporting the map to Lua from Tiled to get this stuff to work.

Ok, thanks, I will do it as you advise.

Do you still need help?