/A Timer & Tick Rotation Problem/

Hello, What I want to do is to calculate the angle between 2 vectors(Already done) and add the resultant angle to the world rotation of the capsule EVERY 4 SECONDS using timer.

However this doesn’t work as capsule rotates a small fraction and stops. I tried switching tick with timer but then, it adds the angle infinite times. I tried a set world rotation node but didn’t work either.

I really appreciate your help towards solving this problem. Thank You.

@Everynone, Thank you very much for your quick reply. Yes I want to have smooth rotation once timer has set the variable. As you sent in picture 1, do i have to connect the newly set variable (From interp) to tick?

You need to store the return interp value in a variable; otherwise, it will process the first value from 0 to target and next frame it’s going to do the exact same thing, starting from 0 again.

219138-capture.png

Or:

If I understood you right, you want to increase the value every 4s but keep the interp as well in order to reach the newly set target quickly once the desired angle changes? You want to interpolate because you need a smooth animation, right? Could you confirm?

It would need to look like something similar to this:

You generally let the interp node do the heavy lifting, it produces the final value so you no longer need to add rotation, but set it instead.

or like this:

Essentially, every 4s you set a new target value for the interp node (fAngle), and the rest is done automagically in the Tick. Depending onthe interp speed, you will reach the target value sooner or later.

Thank you for your help Everynone. It seems like it worked. But have a small problem I would be glad if you helped me. Capsule world rotation is on a (-180, 180) scale. The value I receive(Angle Difference) is - or + (anydegree). Since add rotation node makes an infinite loop, I have to set the (angle difference) to a scale on (-180,180). I tried accomplishing it by adding the capsule angle to (AngleDifference), but on 180 degrees mark weird stuff happen and character spins wrong sides infinitely. I hope i could explain.

Not sure what you mean exactly but it sounds like you got into GimbalLock, do correct me if I’m wrong.

This seems to work. Perhaps the only thing you need to do is to add 180 to your angle.