so i have a problem with my idle animation

so i normally have an idle animation running at all times and have a shooting animation that triggers every time you click. my problem is that during the idle animation when the gun is higher than its starting position, when you shoot it will start its idle animation from that point. It basically makes the gun go higher and higher and point downwards a load.

In order to better assist you, it would be helpful if you could provide more information about your problem, such as the code you’re using to manage the animations, the version of Unity you’re using, and any relevant screenshots or videos of the issue. Providing more details will help other users understand and address your issue more effectively.

That being said, based on your description, it seems that the problem may be related to the blending between your idle and shooting animations. One possible solution to this issue is to use Animation Layers or Avatar Masks in your Animator Controller to separate the upper body animation (shooting) from the lower body animation (idle).

To do this, follow these steps:

  1. In your Animator Controller, create a new layer by clicking the “+” button in the Layers panel. Name the new layer “Upper Body” and set its Weight to 1. This will ensure that the animations in this layer will completely override the base layer animations for the masked body parts.
  2. In the new “Upper Body” layer, right-click the Any State node and create a new transition to your shooting animation. Configure the transition settings as needed, such as setting the trigger for shooting and disabling the exit time.
  3. Create an Avatar Mask in the Unity Project window by right-clicking, selecting Create > Avatar Mask. Configure the mask to only include the upper body bones (e.g., spine, arms, and hands).
  4. In the Animator Controller, select the “Upper Body” layer, and in the Inspector, set the Avatar Mask field to the mask you just created. This will ensure that only the upper body bones are affected by the animations in this layer.

By doing this, your shooting animation should no longer interfere with the idle animation, and the gun should stay in its correct position. If you still have issues, please provide more information, and we will be happy to help you further.