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"

Am I using Lerp (Rotator) wrong (or use Rinterp)?

Hello everyone,

I recently tried some simple things in blueprints and was confused by what was happening.

What I want to achieve: A Blueprint Actor placed in my level which is controlled via external inputs (getting signals via OSC, that part is working without problems). Basically I'm setting a target rotation when I receive an Event, which then should lead to the Blueprint Actor rotating from it's current rotation, to the rotation target set.

Setup: As I wanted to have some follow up Animations (graphics on the Hud fading in when receiving the finished tick from the timeline), I set up a timeline, animating a float from 0 to 1 in a certain time and connected everything to a Lerp (Rotator) Node. As I understood it, the Node "fades" between the Value A and B via the alpha Value it receives.

Blueprint with Lerp (Rotator)

I actually thought this worked until I tried to change the length of my Timeline (therefore the length of the rotation time) and I recognized that it's not really influencing the Lerp in the way I would have imagined. Even if I set the Timeline length (and of course the corresponding keyframes in it) to long times like 10 seconds, the rotation seems to finish in about 1 second. I printed the timeline output, which is just fine 0 -> 1 in the set time.

But the rotation of the lerp is weird, let's say the current rotation is 0,0,0 and the target is 0, 10, 0 it rotates to ~0.98 in the above mentioned second..and for the rest of the timelineAnimation time it increases in ~0.001 steps.

Am I getting something wrong with the Lerp Rotator here?

I read that Rinterp could achieve a similar effect. I tried this too and it works. My only "problem" with it is, that I wanted to use the timelines "Finished" tick, to set up a popup on myHUD, as the animation finishes. I'm actually not sure how to achieve this effect with the Rinterp, as I don't know when the rotation is finished.

Contrary to the "Timleline-Lerp" idea above, where the duration of the animation is set by timeline, the duration of the rotation using Rinterp varies (as the angles between the rotation targets will differ) Therefore a timed fade in of the popup won't work (if I'm not getting this wrong)

Any suggestions how to solve this would be highly appreciated!

Thanks in advance :)

Daniel

Product Version: Not Selected
Tags:
lerpquestion.jpg (132.8 kB)
more ▼

asked Mar 20 '15 at 12:11 PM in Blueprint Scripting

avatar image

colorofblack
3 2 4 8

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

2 answers: sort voted first

You might be facing an exponential movement problem with that way that lerp is setup. It happens with certain scenarios.

Try setting the actor rotation as a variable before triggering the timeline, and use that as A in the Lerp.

more ▼

answered Mar 20 '15 at 11:31 PM

avatar image

DG Gage
1.7k 62 31 129

avatar image colorofblack Mar 24 '15 at 09:26 AM

Exactly this was the problem. (A friend that checked the BP with "fresh eyes" saw it too :D) Simply save the Rotation to a variable so you're not using the already animated current rotation and it will run smoothly.

As for the Rinterp: It seems really nice if you want to work with speed (and therefore variable animation lenghts), but you have to do more checking (when is it close to the target -> from this point on animate linear or you face an exponential movement problem too as far as I can see) I guess I try to figure out a solution for this the next time :)

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

The Lerp node will clamp input to between 0 and 1, meaning it only use values from 0 to 1. You should try to divide the alpha value with the total timeline length, then feed the result to the Lerp node.

more ▼

answered Mar 20 '15 at 02:00 PM

avatar image

CKong
874 26 18 48

avatar image colorofblack Mar 20 '15 at 02:32 PM

Hello CKong, thanks for your response!

As written above I'm already animating my timeline (float) from 0 to 1 as output, which should be in the alpha range? The output from the timeline seems just fine too hmm.

alt text

(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