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: https://github.com/ldurniat/Tiled-Collision-Editor-Plugin

I import the maps like this:

local filename = event.params.map or "scene / game / map / sandbox.json"
local mapData = json.decodeFile (system.pathForFile (filename, system.ResourceDirectory))
map = tiled.new (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 ("scene.game.map.monster")
-- 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 README.md:

Usage

local physicalData = tiledCollisionEditor.getPhysicalData( 'maps.map' )

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.
regards

Do you still need help?