# Is it possible: Place object for every selected tile

**URL:** https://discourse.mapeditor.org/t/is-it-possible-place-object-for-every-selected-tile/4692
**Category:** Questions
**Created:** [August 16, 2020, 4:06pm UTC](https://discourse.mapeditor.org/t/is-it-possible-place-object-for-every-selected-tile/4692 "2020-08-16T16:06:29Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Sgt\_Hemmi](https://avatars.discourse-cdn.com/v4/letter/s/e36b37/32.png) [@Sgt\_Hemmi](https://discourse.mapeditor.org/u/Sgt_Hemmi)
#### Post date: [August 16, 2020, 4:06pm UTC](https://discourse.mapeditor.org/t/is-it-possible-place-object-for-every-selected-tile/4692/1 "2020-08-16T16:06:29Z")

</div>

Imagine having a tile-layer with just sprites of a wall on it:  
Is it possible to create an object on every tile, that has a wall-sprite on it?

Or is it possible to select some tiles (for example water-tiles) and creating objects on every tile, that is selected?

---

<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: [August 16, 2020, 7:22pm UTC](https://discourse.mapeditor.org/t/is-it-possible-place-object-for-every-selected-tile/4692/2 "2020-08-16T19:22:02Z")

</div>

Hey @Sgt_Hemmi, welcome to the Tiled forums!

First of all I wonder a little about the purpose of doing this. What would you do with all these objects? What information will they add?

Assuming you really need these objects, you could automate the placement of these object in two ways:

- The [Automapping](https://doc.mapeditor.org/en/stable/manual/automapping/) feature allows creation of objects based on matching tile patterns. On Windows, Tiled ships with an example of this in the “examples/sewer\_automap” folder. You can also find this example [in the repository](https://github.com/bjorn/tiled/tree/master/examples/sewer_automap). Rules 008 and 009 place an object.

- The [scripting API](https://doc.mapeditor.org/en/stable/reference/scripting/) enables you to iterate all tiles of a tile layer or just the selected tiles in JavaScript, as well as allowing you to place objects. See the [rectangle-chain](https://github.com/mapeditor/tiled-extensions/blob/master/rectangle-chain.js) example for how to place objects using a tool (though, you’d probably want to do so using a custom action, like [find-object-by-id](https://github.com/mapeditor/tiled-extensions/blob/master/find-object-by-id.js)).

---

<div class="post-metadata">

### Author: ![Sgt\_Hemmi](https://avatars.discourse-cdn.com/v4/letter/s/e36b37/32.png) [@Sgt\_Hemmi](https://discourse.mapeditor.org/u/Sgt_Hemmi)
#### Post date: [August 17, 2020, 4:31pm UTC](https://discourse.mapeditor.org/t/is-it-possible-place-object-for-every-selected-tile/4692/3 "2020-08-17T16:31:19Z")

</div>

Hey there!  
I`m using pytmx and i place on every tile, that has an object called "wall" an obstacle, so players can`t move on that tile. The idea was having a layer with painted walls and creating objects on every painted tile on that layer.  
But i already figured out how to program a function in pytmx so its placing an obstacle on every visible tile.  
But thanks for the ideas!

---

<div class="post-metadata">

### Author: ![eishiya](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/eishiya/32/2534_2.png) [@eishiya](https://discourse.mapeditor.org/u/eishiya)
#### Post date: [August 17, 2020, 5:33pm UTC](https://discourse.mapeditor.org/t/is-it-possible-place-object-for-every-selected-tile/4692/4 "2020-08-17T17:33:29Z")

</div>

You can assign collision to tiles in your tileset and draw upon that data in your game, as well.
