Hello,
I finished the Laser Defender course and have been modifying a bit. I’m stuck on trying to create images that represent player lives. I know what I want to do but I don’t know how to implement it.
First, just want to add the child objects of the HealthCanvas to a list on the HealthCanvas GameObject. These objects just represent an Image Sprite of the ship that I’m using.
Then I want to assign a value to each child object as the number of lives the player has.
My issue right now is that I cannot seem to get the child objects of the HealthCanvas into the list. I suppose I could manually drag them over and enable/disable them depending on the number of lives the player has but I want to eventually create them programmatically so if the player gets a score over 10k I can reward them with a new life.
I’ve watched Rick’s for/foreach and list videos in the 2d course probably 20 times. I’ve searched on the internet for a simple example. All I found was a Zelda like heart system. I don’t need half or quarter ship health values and I cannot extrapolate the example they give into a simple 1, 2, or 3. ship lives health system.
Any direction would be appreciated.