# Problem with pattern collision editor

**URL:** <https://discourse.mapeditor.org/t/problem-with-pattern-collision-editor/4341>\
**Category:** Questions\
**Created:** [February 9, 2020, 1:57pm UTC](https://discourse.mapeditor.org/t/problem-with-pattern-collision-editor/4341 "2020-02-09T13:57:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![polu](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/polu/32/2641_2.png) [@polu](https://discourse.mapeditor.org/u/polu)\
**Post date:** [February 9, 2020, 1:57pm UTC](https://discourse.mapeditor.org/t/problem-with-pattern-collision-editor/4341/1 "2020-02-09T13:57:24Z")

</div>

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

I import the maps like this:

```auto
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:

```auto
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"]))

```

---

<div class="post-metadata">

**Author:** ![bjorn](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/bjorn/32/1599_2.png) [@bjorn](https://discourse.mapeditor.org/u/bjorn)\
**Post date:** [February 11, 2020, 10:24am UTC](https://discourse.mapeditor.org/t/problem-with-pattern-collision-editor/4341/2 "2020-02-11T10:24:56Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![polu](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/polu/32/2641_2.png) [@polu](https://discourse.mapeditor.org/u/polu)\
**Post date:** [February 11, 2020, 7:03pm UTC](https://discourse.mapeditor.org/t/problem-with-pattern-collision-editor/4341/3 "2020-02-11T19:03:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ldurniat](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/ldurniat/32/1485_2.png) [@ldurniat](https://discourse.mapeditor.org/u/ldurniat)\
**Post date:** [February 13, 2020, 8:03pm UTC](https://discourse.mapeditor.org/t/problem-with-pattern-collision-editor/4341/4 "2020-02-13T20:03:56Z")

</div>

Do you still need help?
