- Home /
Extending TileMap to "paint gameobjects"
I've been playing around with the tilemap and am looking for a way to paint some tiles with that contain game logic. Rather then just painting tiles I want to occasionally paint tiles that actually instantiate gameobjects. After reading the documentation for the tilemapper it appears to be something I should be able to do, however I am running into a few issues with placement of the assocaited gameobject. The appers to instantiate the object at (-.5f,-.5f) from the location of the tile and I can't seem to figure out why... This is what it ends up looking like (the green object is the prefab and the cyan one is a reference sprite for this tile)
The position of the referenced prefab is V2.zero so that's not it... Here's a shot of the Tile asset I've made.
The class that defines that asset is empty and just implements Tile
[CreateAssetMenu()]
public class BlockTile : Tile {
}
I cant' seem to figure out what's causing the tile painter to place the gameobject like this (the pivot of the prefab is correctly in the center of the square sprite). Help is most appreciated! I've tried messing with all the tile flags and other options. Nothing seems to alter this positioning. I must be missing something!
Your answer
Follow this Question
Related Questions
Object Squeezing Between Tiles 0 Answers
2D/Orthographic Tile Alignment Issue 0 Answers
How to use the same tilemaps among multiple scenes (e.g. making it a prefab)? 0 Answers
2D tiles, which is the best approach? 2 Answers
My 2D tiles have holes in them 0 Answers