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 progress bar percent animation

So there is the deal,here is my inventory widget

alt text

alt text

as you can see I select different item,it show the different value of the orange bar.

here is how I done with the orange bar. alt text

alt text

I thought I can use timeline to do this,but it cant. can someone tell me how to animate the orange progressbar percent ? (the orange bar will increase or decrease when select different item)

Product Version: UE 4.12
Tags:
1.png (337.3 kB)
2.png (316.0 kB)
3.png (330.7 kB)
4.png (281.6 kB)
more ▼

asked Jul 28 '16 at 08:08 AM in Using UE4

avatar image

Roya Dimanod
3 2 3 5

avatar image eXi Jul 28 '16 at 08:38 AM

So you want it to use the old value, of the previous item, and then "move" from there to the new value?

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

1 answer: sort voted first

Unfortunately there is no "easy" way to do this as UMG animations require fixed values in their animations. What you can do is the following:

  1. Have a CurrentValue float, a TargetValue float and a AdjustSpeed float.

  2. Whenever you modify the value, modify the TargetValue

  3. In your widget's Tick event, first check if the CurrentValue and TargetValue are different (use NearlyEqual when comparing floats)

  4. If they are, interpolate the CurrentValue toward the TargetValue (Use InterpTo or InterpToConst). Use the AdjustSpeed as the Speed input.

  5. Set the new value to your progress bar's value

You can optimize this a bit by enabling the tick on your widget when the value changes and disabling it when it reaches the target. This approach has the advantage that even if the value changes mid-transition it will still work correctly.

more ▼

answered Jul 28 '16 at 09:24 AM

avatar image

DamirH
589 22 23 41

avatar image Roya Dimanod Aug 01 '16 at 03:42 AM

just what exactly is InterpTo? How can this help me with my animation?

I thought it will run percent 0 to target value smoothly,but it just jump to the target value

InterpTo didnt work,nither does InterpToconst alt text alt text

11.png (158.6 kB)
22.png (164.5 kB)
(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