Download

Looping an Animation Sequence forward and backward

Hello

I’m still relatively new to UE4 and I’m tying to figure out how to loop an Animation Sequence (mocap import) so when it reaches the end instead of jumping back to the beginning it starts going backwards, as in a ping pong movement. First I thought this could be achieved by using an Animation Blueprint and Animation Notifications but I can’t figure out how to get a reference to a custom notification inside the Animation Blueprint graph. Am I missing a simpler way of achieving this?

Thanks!

well the lazy way would to be to make a copy of the forward animation and set its time scale to -1. This will cause the animation to play backwards then if you make a Montage and add the two clips one after the other it will loop backwards and forwards

Thanks! I didn’t know about the Montage asset. It makes sense to do it the way you say. I’ll give it a try.

I was looking for the equivilent of FMath.pingpong from unity to use in c++ basically the same thing OP wanted but in code. You give it two vectors and each time its called it will return the next interpolated result.

void Update() { transform.position = new Vector3(Mathf.PingPong(Time.time, 3), transform.position.y, transform.position.z); }

Is there anything like this in UE4?