How do I spawn an object on each tile on a tilemap

1 favourites
  • 6 posts
From the Asset Store
Each tile 64 by 64 pixels - Ultimate Tile Set for your awesome games
  • Im trying to spawn an object on all edges of each tile of a tilemap , basicaly i only want to spawn an object in the tiles that arnt empty

    I want to spawn an edge for the player to climb on , on all edges of tiles

    Is there a way to only spawn objects on the tiles that have the same tiles , like spawn object on only tiles that have tile image 0 or tile image 3 and so on

    How do i do this?

    Tagged:

  • + System: For "x" from 0 to Tilemap.Width÷Tilemap.TileWidth
    + System: For "y" from 0 to Tilemap.Width÷Tilemap.TileHeight
    ----+ Tilemap: Tile (LoopIndex("x"), LoopIndex("y")) = n
    -----> System: Create object Sprite on layer 0 at (Tilemap.TileToPositionX(LoopIndex("x")), Tilemap.TileToPositionY(LoopIndex("y"))), create hierarchy: False
    
  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thank you , Do you mind showing me how you do it on construct , because im using ur code and its only spawning the object on some of the tiles, for some reason its skipping some tiles 🤷‍♂️

  • It will spawn on the tiles you define, which I have noted as "n".

  • Yeah but N is only one unit, only the x or y , i need for both x & y

  • Ohhhhhh duuuuuuude, ur a freakin genious, duuude u figured it out :0

    So the loop index code is actually calculating the tilemap object itself not the tilemap on the scene/layout of the game?

    If you want , can you add me on discord , i want to give you this game im working on for free, for helping me, when im done with it ofcourse , Discord ZtarDuzt#8322

    And maybe we can also work on some projects together idk, but add me

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)