Pausing rotation during an animation montage.

So, I have a top-down camera, with the player moved by WASD and a mouse cursor for interactions and attacks, but not movement. The player is set to get their world rotation from movement, but will rotate to face the mouse cursor when an attack is made. However, inputting movement during the attack can change the rotation. I’m currently fixing this by just disabling movement during the attack montage, but I started to go over the whole project and improving things, and I really want them to be able to move at a reduced speed with their rotation locked. I can’t seem to find a middle ground, though. The ideal would be that they start strafing when the animation montage starts, then transition back into regular movement when it ends. It feels kind of clunky right now, and I want the player to feel more mobile.

Edit - Thanks to Arodi007 with the answer. This is probably not my most elegant work, but it works perfectly and the animation looks close enough to a strafe that I don’t need to dig into the more complicated stuff.

1 Like

You can try to add a bool IsAttacking, and use that bool during the “will rotate to face the mouse cursor when an attack is made” such that it doesnt take the yaw value but keep the character initial yaw. (so the check bool just after the attack started)

For the strafing effect, you will need a lerp with function timer or timeline, and keep 2 variable, one initial rotation before the attack started and a target rotation after the attack. At end of anim montage, do a lerp rotation or combine with an animation.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.