Week 7 Dev Log (20/02/2023– 27/02/2023)


Overview Of This Week

This week my goal was to complete the remaining week 4 fundamentals tasks. The remaining ones to complete will be shown below:


• Something that tracks the player’s health
• Something that counts down an ability cooldown – such as jump frequency
• Something that tracks progress of a goal – such as a pickup tracker

Something that tracks the player’s health

My first task that I tried to complete this week was implementing the health for the UI for the player. It was relatively simple to implement. The final image for how it looks on screen are as follows:

Left Side Of Screen

The Red bar is the health. The blue bar is the mana (will be expanded on later in the blog). The health bar uses the health variable from the player and passes it to the UI widget component that normalises the bar from 0 to 1. The yellow bar is the ability cooldown which controls the cooldown for the player to switch the worlds. Unfortunately the code is half complete and will be completed for next week.

Health Loss

When the player collides with the zombie, the health will be lost which will update in the UI blueprint to set the progress bar to the new value.

Something that tracks progress of a goal – such as a pickup tracker

Right Side Of Screen

To the right of the screen checks the amount of coins that the player holds when he/she picks them up from a dead zombie. This follows similar logic to the health bar. The difference is that it takes the value of the amount of money that the player holds to input it to the UI component. It isn’t a progress bar either but a simple text component that converts the coin value to a text value in order to be shown on screen.

Coin after killing zombie
Cash Dollar after picking coin

When picking up the coin, the Cash Dollar pick up tracker will update. Take note that the value is not representative of the emerald coin value. As known before, the coin expires after a certain amount of time and I took too long to pick up the expensive valued coins from the dead zombies.

Extra Things I Have Learnt Or Problems I Have Solved This Week

  • Since the value of the health is an Integer I had problems with the normalisation. When the player would take damage, the bar would turn instantly to a 0 progress bar when the player obviously had more health than 0. This is where I looked deeper into the setting of the health bar in the UI component. The finished script will be shown below:

Originally, the private variable named health used to be an Integer variable rather than a float. This is where I realised my stupidity in expecting an Integer variable to be a fractionalised number. Integers can only be whole numbers! This is why it would instantly turn to 0. This is because the value would truncate to 0. This is where I would instantly convert the values into floats and then normalise them like usual.

  • After creating the health bar, I decided to do the same for the mana. However, I tested using a float for the mana variable rather than using an Integer to see how the difficulty would be in implementing it. I found that I much rather using a float for such values than Integers. It simply gets the mana value from when the player shoots the spell in the main character blueprint. It looks like this after spells are fired from the player:
Shooting Spells

Plans For Next Week

My plans for next week are to fully complete the final task for the week 4 fundamentals as it was much more complex than I was expecting. It is about half finished so should be easy to complete. Whilst looking around my code, I also realised that a few of my scripts could be optimised as well as some areas being documented for easier understanding in the future. This will also be my focus for next week.


Leave a Reply

Your email address will not be published.