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"

AnswerHub Maintenance

Background maintenance is scheduled to occur between 9 - 11am EDT on Tuesday, May 21. Site operation may be slower than normal during this time and a brief interruption in operation may be observed

Get ProgressBar from Widget Component and Update Progress

Hi at all,
I've got a WidgetBlueprint which includes a ProgressBar.
I called it ProgressBarWidget.
I've an Actor, which got the loadingTimeSeconds variable.
This variable includes for the action needed Seconds in float. (The Actor needs X,XX Seconds to finish his Task)

1. How can I get the ProgressBar from WidgetComponent, which includes the ProgressBarWidget Class, to update the Progress with from the Actors provided variable's?
2. How can I let the ProgressBar completely filled within given Seconds?
For example:
Given Seconds: 2,34
The ProgressBar should be filled every X millis (Show Progress) and finished after 2,34 Seconds (100% reached).

Widget Settings:

Function within Actor:
If I could get a Reference of the ProgressBar, which is within the WidgetClass, from the Widget (`TestWidget`).
Then I might me able to Update the Progress of the ProgressBar.
If I could't get any reference of it, from the Widget (`TestWidget`).
Then It would be nice to know, how to attach an ProgressBar to the Actor, which looks like the Image under the Section "Actor Viewport" of my Post.

Actor Viewport:


I've made the Widget visible in Viewport, to show how it looks.
Normally it is invisible and just showing when the Function "`Progress Bar Loading`" is called.

Thanks in advance for any helpful advise.

Product Version: UE 4.19
more ▼

asked Apr 02 '18 at 01:38 PM in Blueprint Scripting

avatar image

7 1 5 7

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

BP_HUD is your ProgressBarWidget. Widget1 is your testWidget. Then you will have access to the progress bar.

alt text

untitled.png (48.0 kB)
more ▼

answered Apr 02 '18 at 02:44 PM

avatar image

481 3 5 12

avatar image Halki Apr 03 '18 at 12:56 PM

Worked, thanks.

(comments are locked)
10|2000 characters needed characters left

You will need to store the created widget reference for that.

Either you can add a function inside your ProgressBarWidget called "UpdateProgressBar" with a float input and set the bar progress inside of it OR You get the stored reference and you will be granted access to all variables from this class. Just make sure to check the "IsVariable" box right next to your ProgressBar widget name.

alt text

ah.jpg (8.8 kB)
more ▼

answered Apr 02 '18 at 02:11 PM

avatar image

49 6 13 15

avatar image Halki Apr 02 '18 at 02:22 PM

I think you misunderstood the difference between a WidgetBlueprint and a WidgetComponent.
Or did you want to tell me, that I need to create the Widget (`ProgressBarWidget`) without adding it to the Viewport and it will get a "magic" reference to the ProgressBar within the WidgetComponent?
Please explain it to me.

avatar image Halki Apr 02 '18 at 02:28 PM

My ProgressBar, within the ProgressBarWidget, is called GenericProgressBar.
But I can't get a access.
WidgetComponent, which contains ProgressBarWidget class:
Widget Component

Try to find GenericProgressBar: GenericProgressBar

avatar image Gbr Apr 02 '18 at 11:29 PM

Ah, sorry. My fault!

Actually, the solution is what EvilCleric has posted.

Got an example Crosshair Widget I've created in a project to show you how to actually access it from WidgetComponent.

alt text

ah2.jpg (44.2 kB)
(comments are locked)
10|2000 characters needed characters left
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