For each tile of a certain ID how do I spawn an object?

1 favourites
  • 3 posts
From the Asset Store
Each tile 64 by 64 pixels - Ultimate Tile Set for your awesome games
  • I have a basic tilemap building system where there's a number in a textbox and wherever you left click the tile will correspond with that number in the textbox.

    Tiles 340 to 390 are designated for 3d objects, when you click to place any of those objects, a corresponding 3d object appears ontop of the place where the tile is. If a tile other than 340-390 is being placed in the same spot, an invisible item removes the 3d object and the tilemap is changed to the new ID + new 2d tile image.

    Right now I have two issues.

    1. I want to use the tilemap to spawn 3d objects at the start of the layout.

    Right now if a tile is ID 390 for example on the tilemap before I run the game, the tile will not create a 3d object over it.

    2. When i'm clicking to spawn in each tile, is there a way where I can simply correlate the ID to the object rather than manually say "387 is right wall, 388 is left wall, 389 is bottom wall"

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Technically you could have an array with the IDs in one column and the name of the object to create in the next column and then run a function to locate the ID position at X,0 in the array and use 'Create object by name' at X,1.

  • Technically you could have an array with the IDs in one column and the name of the object to create in the next column and then run a function to locate the ID position at X,0 in the array and use 'Create object by name' at X,1.

    I was thinking maybe you could step through the array and have like x,y correlate to a tile position on screen and simply hold the tile number and for each tile number just spawn the 3d object but i have no idea how to actually do either what you said or that

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