Steps for unity to create animations

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.