x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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.

alt text

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

Product Version: UE 4.20
Tags:
more ▼

asked Mar 24 '19 at 12:23 PM in Blueprint Scripting

avatar image

Murkoy
3 1 3

avatar image Murkoy Mar 24 '19 at 06:00 PM

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.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

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.

https://www.youtube.com/playlist?list=PLyu-W38DvZhqByAoeva1jewB5s78zQHIy

more ▼

answered Mar 24 '19 at 05:57 PM

avatar image

Nebula Games Inc
5.4k 28 9 14

avatar image Murkoy Mar 24 '19 at 11:35 PM

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?

alt text

progressbar.png (165.0 kB)
progressbar.png (165.0 kB)
avatar image Nebula Games Inc Mar 24 '19 at 11:49 PM

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.

avatar image Nebula Games Inc Mar 24 '19 at 11:54 PM

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.

avatar image Murkoy Mar 25 '19 at 12:58 PM

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:

alt text

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

alt text

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

alt text

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!

avatar image Nebula Games Inc Mar 25 '19 at 01:41 PM

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 alt text

The actor with the 3D widget component alt text

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. alt text

avatar image Murkoy Mar 26 '19 at 01:08 PM

Hi Nebula,

THANK YOU SO MUCH...

Such a simple solution, but so damn 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 :)

avatar image Nebula Games Inc Mar 26 '19 at 01:32 PM

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

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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 https://www.tutorialspoint.com/cplusplus/cpp_inheritance.htm

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.

more ▼

answered Mar 24 '19 at 12:55 PM

avatar image

Przemek2222
296 4 10 14

avatar image Murkoy Mar 24 '19 at 06:00 PM

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.

avatar image Nebula Games Inc Mar 24 '19 at 06:08 PM

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.

avatar image Przemek2222 Mar 25 '19 at 12:20 PM

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)

avatar image Nebula Games Inc Mar 25 '19 at 12:51 PM

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

avatar image Murkoy Mar 25 '19 at 01:01 PM

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"

avatar image Murkoy Mar 25 '19 at 01:04 PM

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.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question