hello guys, i have some kind of Tower Defence game and one problem with respawn heroes: I have a spawn place(cube) with cript OnMouseDown() wich creating a hero on this cube, and also the script that respawn that hero on this cube everytime the enemy's wave is over. I have a hero with script OnMouseDown() wich creating a PANEL with 2 different Buttons "Upgrade" and "Sell", and if u press the Upgrade button the hero will be destroed and new hero gameobject will be instantiated on the same place. So the problem starts after the end of the enemy's wave so the cube respawn script instantiating the old version of hero and the second problem happens when we had to sell the hero, but the respawn script continues to work and respawning it. The problem is that we have much of the cube's and a lot of hero's and i dont know how to tie the cube with the hero, i believe you understand me, btw sorry for my bad english. Help please))
It sounds like the upgrade functions needs to have some code added to it. Before you destroy the basic hero, you need to update the data in the respawn script. the hero object need to be changed to the new upgraded hero.