Hello unity community!
I’ve created a character who holds a gun and can aim it left and right with animation. To accomplish this task I’ve created a second animator layer with a torso masked and override blend on top of the motion layer with a single motion. In this motion my character moves his hands from -90 degrees (all left) to +90 (all right) in the horizontal plane. The script calculates the angle between the character forward direction and the direction to the mouse cursor and sets the motion time accordingly. The motion speed is set to zero so the animation don’t play and it looks like the character aiming a gun at mouse position when mouse moves. If the angle reaches configured thresholds (-45 to +75 degrees currently), the character is rotated 45 degrees in apporiate direction so it never aims behind his back.
This system, as opposite to using IK, allows artists to easily create nice aiming motions without any programming under the hood.
Now I’d like to add vertical aiming motion. I’ve added another layer on top of horizontal aiming layer with the same mask and additive blending. This layer contains motion where the characted moves his hands from top top bottom. It’s speed is zero and time being always set to show the vertical angle. But something goes wrong here. The horizontal motion doesn’t getting added to the vertical one. The player is moving hands from middle right to top center positions despite the time set for other angles. When I disable one of the layers (set weight to 0) another works as expected.
May someone explain to me how exactly additive blend works in Unity and how to create two motions - horizontal and vertical - in such a way so when added, they’d give me the required position? I’m completely confused now ![]()