- Home /
Question by
shoopscooper · Sep 01, 2020 at 06:35 PM ·
animationtilemaptiles
tilemap.SetTile not working for animated tiles
Hi there!
I tried to use tilemap.SetTile to set an animated tile and it did not work. I tried to rename a random tile to the same name of the one I was placing and it immediately worked, so it's definitely an animated tile issue... Has anyone else run into this? I can place the animated tile manually, just not via code.
Any advice would be greatly appreciated! Thanks!
Comment
Best Answer
Answer by shoopscooper · Sep 30, 2020 at 01:49 AM
EYYY, I got it working. Dug for a while and noticed the load type:
tilemap.SetTile(getCellPos, Resources.Load<AnimatedTile>("Overworld Tileset/Tiles/" + gameObject.name));
vs:
tilemap.SetTile(getCellPos, Resources.Load<Tile>("Overworld Tileset/Tiles/" + gameObject.name));
Notice the difference between Load types!