Animation Aim Offset Jerkiness Help Needed (4-27)

Hi everyone, I need a little help. Following the Unreal tutorial, I’ve created the aim offset. It’s all working fine.
But what I’m trying to do is to trigger that functionality only when the RMB is pressed, and the character is ‘aiming’. That part also works fine, but of course, I need to reset the rotation back to the middle of the blend, so the character is aiming straight, when RMB is released.
And this is where the problem is: I can do that in the same place, in the Event Blueprint update animation of my animation blueprint, once the char is not aiming, set Yaw and Pitch back to zero. However, I don’t really want to do it here, as from my understanding, this is run every frame.

So, I can instead do it from my char blueprint. The aim logic is on RBM click, when RMB is released, the character is not aiming, and I thought it’s a great place to reset the aim offset’s yaw and pitch here. I am using Timeline node after reading through some other suggestions, and feeding it into an ease function (I’ve tried lerp, too). And then the timeline in Update updates the values. Now, it looks great, everything works.

What doesn’t work is the next time I aim, the aim offset seems to get stuck, and I can get it unstuck basically by moving the mouse around for a bit. I have confirmed that this ONLY happens if I try to implement that reset logic in the char blueprint. And I just don’t understand why. In theory, it should work, and the very first time you go into aiming, and then release the right mouse button, it’s all good. I’ll attach some snippets showing my spaghetti coding (I’m sorry).

Here’s a video showing the problem: Anim Aim Offset Issue. - YouTube


Hi everyone…so a ‘doh’ moment, after I had a second pair of eyes look over this, we took a look at the timeline, and it has a length parameter, which was set to 5 (which I assume is 5 seconds?). So even though my last key there was set at 0.1, I think it was still trying to keep values at 0 for another 4.smth seconds after. That’s why I was seeing that weird jerkiness using the aim for the second time. So, this can be resolved, maybe it will be useful info for someone else.