Steps to create an animation:
1. Import models and animations to set up
2. Creating Animator Components
3. Create and set animator Controller
To set the settings above see Animatorcontroller settings below
4. Set the script to animate the control
When adding script code, the first thing to do is to get the animator component on the object itself.
Get method:
First set private Animator _animator;
void Start () {
_animator = transform. Getcomponent<animator> ();
}
Write code in Update:
if (Input.getmousebutton (0))
{
_animator. Settrigger ("Attack");
}
if (Input.getkey (KEYCODE.W))
{
_animator. Setbool ("Isrun", true);
}
if (Input.getkeyup (KEYCODE.W))
{
_animator. Setbool ("Isrun", false);
}
Where the parentheses represent the name of the animation
Animatorcontroller settings:
First add a dynamic animation to the animator:
1. Add a game action to it
2. Set the arrow to control the flow direction of the action:
3. Adding events that are triggered
The added value is used in parentheses in the following script
4. Click the arrows to set the trigger event
(1) Attention points:
of which:
If the check box is checked, the event will be delayed a few seconds before it runs
If the tick is canceled, the time will be executed immediately.
(2) Attention points:
Double-click the animation event to double-click the run animation in which you found the following:
Where loop time indicates whether the loop plays
Hope to help everyone!!!!!!!
Steps for unity to create animations