Day 4

Just when you think you have things down on Unity, you realize there is so much more to learn. Today I encountered a problem while testing the # of lives x damage coding. For the life of me, I couldn’t figure out why I was losing 2 lives instead of 1 when my player encountered an enemy.

Here are some of the codes that I used to try to fix the problem:

__lives; / __lives=__lives-1; / __lives-=1;

I looked back at my player and enemy codes, back-tracked through the Players Lives and Damage Reboot (course work video developed by GameDevHQ) multiple times, and finally contacted my team through Slack. Contacting my team was helpful, they offered me advice and recommended I send them my codes to figure out the problem. Unfortunately, none of the solutions recommended to me didn’t work. I went back and forth between the Unity and Visual Studio program and almost decided to redo my entire project. Just as I was considering the idea, as I was going through the enemy inspector (on Unity), I realized there was duplicate script . Once the duplicate was removed, damage dealt to my player was then amended to 1 life per hit.

Figuring the problem out on my own felt good. Nonetheless, I would like to thank team-C at GameDevHQ, for always helping me out and responding so quickly to my messages. This opportunity provided by the Aloha Connect Innovations program and the State of Hawai’i has been a blessing to me and so many others!

--

--