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"

UAnimInstance::GetCurveValue() returns wrong values when transitioning from another state

Hi,

I have an animation curve in my sequence that plays from 1 to 0 in a linear fashion, when I play this animation on a transition from another state I grab the curve value by it's name with GetCurveValue(FName("DistanceCurve")); and print it's value on the output log.

Why is it that instead of starting at the initial values (1.0f) the values start at cero and ramp up until they catch up with the actual curve values? Also is there a way to get the actual curve values coming from another state without having this issue?

My initial guess is that the animation is blending coming from another state and that's why I cannot get the actual values of the curve until the blending is done.

Any help on this would be appreciated.

alt text alt text

Product Version: UE 4.18
Tags:
more ▼

asked Nov 28 '17 at 04:15 PM in C++ Programming

avatar image

virtual_nomak
356 15 16 25

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

1 answer: sort voted first

Found the issue, the problem is indeed a blending issue, you see between animation states there is a standard blending being applied, and if you click on the transition rule you will see these settings, by default there is a 2 second blending happening and this is affecting how much the weight is applied on the incoming animation, that's why the animation curve doesn't show the actual values when transitioning.

To get the actual curve value after the trasition I had to set the blendtime to 0sec and check if there is a curve when I request it before using it's value, like

 float DistanceCurveValue = 0.0f;
 if (GetCurveValue(FName("DistanceCurve"), DistanceCurveValue))
 {
      // do something
 }

I hope this can help someone else looking for the same answer.

more ▼

answered Nov 29 '17 at 10:30 AM

avatar image

virtual_nomak
356 15 16 25

(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