How to create a floating progress bar set to Delay on an object?

Hi all,

Bit of a noob question here, but I hope someone can help me since I’ve spent most of the day looking at solutions which didn’t help me.

I am trying to create a progress bar that appears above either the player character or object set to a delay (which is a variable called ‘build time’).

Currently, the player enters a collision box which enables input. Once the player has pressed the correct button, a delay timer is set off (build time). After the delay is finished, the building (in this case a barricade on a window) appears.

What I would like, is for a progress bar set to this delay or build time to appear above the character or object while they are ‘building the barricade’.

I think my problem has to do with casting, which has always confused me as to what the object pin should be. Here is the graph on the progress bar that I have tried to get working so far.

If anyone could help me, or at least point me in the right direction, I would really appreciate it!

I’m not sure I understand correctly what do you want to do but from screenshot I see you got problem with casting.

To understand casting you’ll need to understand C++ Inheritance

It’s very commonly used so it’ll be good idea to understand. I have gave you link but you can find video / page in your language so you’ll better understand.

Generaly when you save variable with Parent class you can place childs inside then you need to cast to get acces to child functionality.

If this function is inside this BP you want to acces then just right click type get variable … or function or drag and drop variable from left side.

You need to get a reference to “Fortify Window” to be able to use variables from within it. If you need help understanding casting and/or how to create references check out video #1 and #25 on casting and creating references respectively. I think it will help you in this situation.

Hi Przemek,

Thank you for your answer and your link, I appreciate the help!

The screenshot is just to show that I’m not sure what the ‘object’ part of casting requires. What should I plug in there?

As for my original question, I am trying to get a blueprint outside of the player have a progress bar that fills up when the player interacts with it. I would like the progress bar to fill up according to how far along the delay command is.

Right now, the functionality I have in place works as follows:

  1. Player enters collision box.
  2. Collision box enables input from player.
  3. Player presses the F key.
  4. Player input is disabled.
  5. Delay is enabled for 3 seconds.
  6. After delay, player input is enabled.
  7. Static mesh components are set to visible.

What I would like is…

  1. Player enters collision box.
  2. Collision box enables input from player.
  3. Player presses the F key.
  4. Progress bar appears above object or player
  5. Player input is disabled.
  6. Delay is enabled for 3 seconds.
  7. Progress bar fills up as the delay reaches its end.
  8. After delay, player input is enabled.
  9. Progress bar disappears.
  10. Static mesh components are set to visible.

Thus, I am not sure how to get a progress bar to behave in this way above the item in question or the player.

I am trying to get a blueprint outside of the player have a progress bar that fills up when the player interacts with it. I would like the progress bar to fill up according to how far along the delay command is.

Right now, the functionality I have in place works as follows:

Player enters collision box.

Collision box enables input from player.

Player presses the F key.

Player input is disabled.

Delay is enabled for 3 seconds.

After delay, player input is enabled.

Static mesh components are set to visible.

What I would like is…

Player enters collision box.

Collision box enables input from player.

Player presses the F key.

Progress bar appears above object or player

Player input is disabled.

Delay is enabled for 3 seconds.

Progress bar fills up as the delay reaches its end.

After delay, player input is enabled.

Progress bar disappears.

Static mesh components are set to visible.

Thus, I am not sure how to get a progress bar to behave in this way above the item in question or the player.

If you look at my link below I think you will figure out what you need to use for the wildcard object pin. As for your other issues, the progress bar would have to be a component of your “building actor” so that you can enable it when the time is right or add it as a child component when the player interacts with the object. As for “filling” the bar, you want a timeline/timer not a delay, those will allow you to change the value of the progress bar variable. A delay will just delay execution but do nothing to your variable so your progress bar won’t update using a delay.

Hi Nebula,

Your tutorials have really helped me understand casting - thank you so much. I have also changed the delay to timers!

Unfortunately, right now the bars don’t update. I have the graphs set to percent, but they’re not working as intended… any ideas?

You don’t want to get the “timeline length” that would be a static number like “5” seconds leaving you with a progress bar filled to a specific point and not “updating”. What you want is to use a timeline to drive a variable of type float to change as the timeline progresses. You can do this using a float track in the timeline and set it to start at 0 and finish at 1. The length of the timeline (the time it takes to go from 0 to 1) would be the amount of time you want it to take your progress bar to fill up. You can then use the output float track from the timeline to update the progress bar in this binding.

Also if you check out video #4 I show you how to setup a widget progress bar to display player health. I think it will help you understand what I am trying to explain to you in my previous comment. The only difference is, instead of player health, you will be using a special float variable that you can update using the timer’s float track.

So I see you are using cast (aren’t you already inside this widget? You can acces then variable without unnecessary casting)

Progress bar fills up as the delay reaches its end.
I would use timeline for this (for smooth effect).

To show widget you’ll need to use node add to viewport. (Or set visibility if this is 3d widget)

To remvoe use node remove from parent. (Or set visibility if this is 3d widget)

I think the name of his widget is “fortify window progress bar”. The actor he wants that on is called “fortify window”

Thanks for your patience and the video.

The bar is still not filling up. I am not sure if I am using the Float Track correctly or if it’s even triggering :?

Here’s what I have:

The above is the float track, which I have created a variable for called ‘Fortify Track’

This is in the widget where I cast and call for it.

This is the actual blueprint where I have the timelines. The problem could be here? I have tried to promote a variable from the float track pins before but they don’t do much for the bar.

Thanks for helping so diligently. I am enjoying your tutorial videos!

Hi Guys, thanks for helping!

I have two separate widgets (because I am a noob).

The first is “FortifyWindowProgressBar” that is the bar that will fill up when fortifying.

The second is “UnfortifyWindowProgressBar” which is the bar that will fill up when taking the fortification down.

The Actor Blueprint is named “FortifyWindow”

Right now where I stand is that I was able to get the bars floating (yay thanks for the tuts!) but I just need them to fill up.

From one of Nebula’s tutorials, I imagine even once I get the bar filling, the “Get all actors of class” function in the widget event graph is going to bite me, since I would like to be able to fortify individually.

This is all messed up haha Here, I just recreated the effect you want, I kept everything super simple in the actor with the 3D widget. The actual widget only has a progress bar.

The widget itself, just a progress bar, custom size (500,50), nothing else

The actor with the 3D widget component

Inside the timeline (you need to right click in the graph area to create 2 “key frames”. The first at time 0, value 0, the second, time X (how long you want to reach completion of the fill, value 1.

Hi Nebula,

THANK YOU SO MUCH…

Such a simple solution, but so ■■■■ effective. I still use a delay after the bar appears since it automatically builds the fortification and gives the player control, but it’s WORKING… thank you so much for your patience and support. You really are awesome.

I’ll be watching your really awesome tutorials :slight_smile:

Anytime man. Glad it is working for you. Simple and working is the goal of all coding haha