Home > Back-end >  How can I make two animations work together in unity?
How can I make two animations work together in unity?

Time:07-18

I'm making a first person shooter and im trying to make a reload animation.

I want to make it look like the hand grabs the mag and pulls it down.

How do I make two animations work together?

CodePudding user response:

I remember having to do that for my wrestling game. What I did was create 2 controllers and 2 animations. Controllers should be the same (have same timing, transition and all that). Then make one animation for example animation of how hand reloads a gun. Now memorize sample rate and in which frame you put keys and what do they do (what do they change). Now start animating how mag is getting pulled BASED on what you have done previously. Like in what frame it should go down and in which frame it should be thrown or new one should be inserted and etc.

Then you will have to enter play mode in order to see them simultaneously. I am making a wrestling game and this method is what I use.

Good luck

CodePudding user response:

https://docs.unity3d.com/Manual/AnimatorOverrideController.html

he Animator Override Controller is a type of asset which allows you to extend an existing Animator Controller , replacing the specific animations used but otherwise retaining the original’s structure, parameters and logic.

This allows you to create multiple variants of the same basic state machine , but with each using different sets of animations. For example, your game may have a variety of NPC types living in the world, but each type (goblin, ogre, elf, etc) has their own unique animations for walking, idling, sitting, etc.

By creating one “base” Animator Controller containing the logic for all NPC types, you could then create an override for each type and drop in their respective animation files.

  • Related