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"

Can't figure out how to make power bar smoothly run out, rather than all at once.

Pretty much as the title says, I've tried everything in trying to make the "Battery Power" on the flashlight run out slowly with each event tick. I got the flashlight to be able to run out after a certain time period. I also have a widget in the top right corner showing how much power is left in the flashlight (Which, will turn red when the flashlight runs out) Both of those work fine. The issue is that when the time for the flashlight is about to run out, one second the bar is full green, the next it's red. I just can't figure out how to make it (the word escapes me right now) but smoothly run out instead of all at once. Where at each tick a small bit of green goes away. If that makes sense. The pictures provided show what I can muster. alt textalt textalt text

Product Version: UE 4.8
Tags:
screenshot_24.png (402.4 kB)
screenshot_26.png (111.4 kB)
screenshot_25.png (463.8 kB)
more ▼

asked Jul 01 '15 at 07:50 AM in Blueprint Scripting

avatar image

TheKronas
6 3 4 5

avatar image Enlo Jul 01 '15 at 08:38 AM

is your question "how do I blend the color of the bar from green to red" or "how do I make my flashlight fade out its brightness"?

To what did you bind that function in UMG?

avatar image TheKronas Jul 01 '15 at 09:09 AM

How to blend the bar from green to red while the flashlight is in use.

I bind the progress bar to percent (GetPercent_1) and the you can see the blueprint in the second screenshot above. alt text

screenshot_27.png (100.8 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

HI Mate

Progress bars go from 0 - 1. So you need to devide to make it work.

Get you "Power" level and divide by Maximum and then attach to Progress Bar

Narg

more ▼

answered Jul 01 '15 at 09:34 AM

avatar image

Narghile
1.7k 74 38 109

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

As mentioned progress bars need to be set in percentages, hence the X 0.01 (100% of 100). If your full battery level is "60" then do 1/60 = 0.017 and thats what you multiply by (divide 1 by the max energy number to get the percentage right)

First thing is print your battery level variable to the screen. Is that function working? Is it slowly depleting as you'd expect from whatever your flashlight power is set to initially... so 100 > 98 > 96 > etc? Is this actually working first? When its NOT in use, does it start to replenish itself? All of the depleting and replenishing functions will happen in your charBP or wherever. The bar is going to just be a visual representation. So if the functions are all working as they should then...you can set up the power bar.

See attached on how to set it up

alt text

progressbar.png (118.5 kB)
more ▼

answered Jul 01 '15 at 09:47 AM

avatar image

thankstipscom
654 38 37 70

avatar image TheKronas Jul 01 '15 at 05:37 PM

Got it to work, awesome! Thank you guys for your help!

avatar image Narghile Jul 01 '15 at 06:48 PM

Happy we could resolve it.

Might need your help one day.

Narg

(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