- Home /
Question by
tetramess · Feb 17, 2018 at 11:59 AM ·
instantiatespritestilemap
Instantiating a sprite in a tilemap's cell
I'm losing my mind - been googling for hours and still can't figure it out. I have a tilemap, and a cell's coordinates X, Y and Z. In my assets there is a sprite called "SpriteName". How do I instantiate it into the cell of my given coordinates? In the tilemap API it says
Tilemap.GetInstantiatedObject
So I wrote:
tilemap.GetInstantiatedObject(new Vector3Int(X, Y, Z))
But how do I connect it with a specific sprite? In every single of tens of examples I googled, everyone writes "sprite", or "item". But WHAT is behind "sprite"? I realise it's really easy, but I just can't get my head around it. I tried sprite name, doesn't work. How do I get it instantiated? Thanks
Comment