Stuck on Setting Tiles in Run time

I am now stuck on why I can’t seem to change the tiles during run time, which is in theory, something that should be able to occur , but seems to be a little more difficult , or at least was at one point for people using the brand new Tilemap construct.

So, it is now solved. Yeah, nothing a few hours of work will do at 3am. I noticed in the base terrain generator that even though I serialized the tilemaps and tilebases, I still loaded them in via GetComponant , which, gee, is starting to become a repeating factor in my issues. Yes, it only took a quick hour to figure this out, and all I did was put the highlighter in its own map and write the few lines of code, before I realized I wasn’t serializing the componants and instead loading them, it dawned on me, references that are passed between scripts will and can be blank. Sooooooo, either you are instantiating them, or loading them. Duh. Of course, the player might be an exception to this, and maybe other static objects. In this case, this game, the player is static. He can be loaded with the scene, since it is rogue like, there is really no point in loading him in ( which you would think is a good reason to not prefab the player object, but you would be mistaken there too…. i mean, what if you delete the object? ).

The highlighter is showing the attack squares, the one the player is on and the one in front of him, since presumably, he is attacking unarmed.

Now, back to the combat manager!

Leave a Reply

Your email address will not be published. Required fields are marked *