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 make progress bar fill at rate when button pushed and then get percent (UMG HUD)

Hello,

I am trying to make a minigolf game currently (starting using the rolling demo) and having some issues with HUD. I UMG hud

I am trying to make a power bar that uses progress bar. It is supposed to on space bar press start filling up to 100 then take that value (do some multiplication to make it a larger) and apply it as an impulse to the x vector. I have the basic set up for a umg hud which I will show images of. I want to make the progress bar fill at a set rate when the spacebar is pushed and the when spacebar is pushed again it should stop filling and take that fill amount and set it to a variable.

alt text alt text

Product Version: UE 4.8
Tags:
capture.png (1.8 MB)
capture2.png (14.7 kB)
capture3.png (65.3 kB)
more ▼

asked Jun 12 '15 at 06:45 PM in Blueprint Scripting

avatar image

KracKr1
0 2 3 5

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

6 answers: sort voted first

So I figured it out now and figured I would share for anyone who was looking for it.

So this code is in my player alt text

In my UMG HUD my progress bar is binded to this code alt text

capture.png (83.3 kB)
capture12.png (67.4 kB)
more ▼

answered Jul 08 '15 at 08:53 PM

avatar image

KracKr1
0 2 3 5

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

Standard Model-View-Controller

The Model is the value of the golf club wind up in percent and is a variable on the golf club (or player maybe). That is where you start.

The View is the progress bar graphics. It gets updated from the Model.

The Controller is the button you are pressing. It changes the Model value.

So you don't get the value from the HUD progress bar. You keep your value in the golf club and set the progress bar.

Model View Controller here

more ▼

answered Jun 12 '15 at 07:03 PM

avatar image

SND R Keene
968 31 120 113

avatar image KracKr1 Jun 12 '15 at 07:34 PM

Okay I think I understand what you mean. However, currently we are not using a model to hit the ball. We are only using ue4 add impulse to the x direction.

I also do not understand how to do the model has the value.

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

So you have a player and they push the button to wind up the swing. In the Player blueprint you have a Variable float that is the windup. Each tick if the key is held down you add some amount (per second) multiplied by the delta time.

Then each tick you set the progress bar.

When they release the key you have the wind up amount and use that to hit the ball.

more ▼

answered Jun 12 '15 at 07:52 PM

avatar image

SND R Keene
968 31 120 113

avatar image KracKr1 Jun 19 '15 at 05:18 AM

Sorry for the delay and thank you so much for your help. I have been able to achieve control of the ball by holding down the E key and it applies an impulse; however, this does not show up on my Progress Bar as filling or showing the amount as intended. Can you tell me where I am going wrong with the UMG HUD. Thank you.

capture.png (165.2 kB)
capture2.png (143.7 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

I see in Event tick where you are updating the TimerCount which is good, but I don't see where you ever set the progress bar value?

more ▼

answered Jun 19 '15 at 04:24 PM

avatar image

SND R Keene
968 31 120 113

avatar image KracKr1 Jun 19 '15 at 11:19 PM

Isnt setting the powerfill binded to the progress bar setting the progress bar?

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

Yes, a bound variable should work. IS the range right? 0.0 to 1.0 or maybe 0 to 100.0 ?

more ▼

answered Jun 20 '15 at 05:26 AM

avatar image

SND R Keene
968 31 120 113

avatar image KracKr1 Jun 20 '15 at 05:29 AM

Yeah I will change that however, the way the code is written right now it only is showing up hud now only after the e button is released how do I get it to show the progress bar raising?

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

In the OnTick update the bar.

more ▼

answered Jun 20 '15 at 04:50 PM

avatar image

SND R Keene
968 31 120 113

avatar image KracKr1 Jun 20 '15 at 04:54 PM

How do I do that?

(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