New animation system in Unity 4.0--mecanim

Source: Internet
Author: User

Share a document, about the animation system, the version should be very old, but it is useful for reference;

Unity 4.0 was officially released on November 15, 2012, and Unity's ascension for every release was a surprise to game developers, and this time, one of the biggest changes in the version was the introduction of the new animation system--mecanim, through Mecanim new animation system, the developer in U Character animations can be very easily implemented in nity. So the Unity 4.0 splash screen highlights the newest feature of the new animation system.

It should be explained that in Unity 4.0, developers can still use the original animation system, that is, the use of the original non-character animation system, the specific steps are not described in detail here.

In the new Mecanim character animation system, we need to implement the role animations in Unity using the following steps:

1. Import character animations

2. Create a character animation Avatar

3. Add character animation controller, set state machine, set up mixed tree, implement encoding and control character animation

In the import role animation process, similar to the original animation system, if the role animation model already includes related animations, in the Animation tab, you can automatically import related animations, as shown in 2.

Figure 2 Animation Settings interface

In Figure 2, when you import a character animation, the animation set by the original model is well recognized by Unity and divided into many animated segments, where the developer can also adjust the starting and ending frames for each animation. The Idle animation segment, is from 0 to 245 frames.

Of course, you can also set the animation section manually, which is basically the same as the original animation system, here is no longer repeated,

As shown in 3.

3 Manually set animation segments

In fact, the role animation import, and the original unity is no different, just within unity to transform, identify the relevant model and animation section, but also, this step and the original animation system is exactly the same.

  In the process of creating a character animation Avatar, this step is a step that must be added by the new Unity 4.0, and the new Unity 4.0 is implemented by Avatar this proxy to set the skeleton and skinning in the character animation.

In Figure 4, click the Configure button in the Rig tab to create a Avatar for the currently imported model, and the interface shown in 5 opens.

Figure 4 Creating a Avatar

By creating the Mapping tab in Avatar, you implement a skeleton-to-Unity mapping in a character animation, which means that unity can set the skeleton information in the role, as shown in 5.

By creating the Muscles tab in Avatar, you implement the mapping of skinning to Unity in character animations, that is, unity can set the skin information in the role, as shown in 6.

By creating a character animation Avatar, in the new animation system Mecanim, Unity sets the skeleton and skinning information of the character animation so that character animation can be implemented in unity.

With the 2 steps above, character animations have been imported into unity, unity already has skeleton and skinning capabilities to recognize character animations, and developers can develop character animations using the new interface and related features.

  Especially exciting: In the new Unity 4.0 new animation system, the developer can take advantage of the role animation redirection function, the other any animation action to bind to any role model that the developer needs to specify, so that the bound role also has the specified animation function, to achieve the re-use of animation action, This has the potential to completely separate the work of the artists and developers, greatly improve the efficiency of the development of the game, at the same time, it can be expected that the future of Unity in the role of animation is no longer mysterious, there will be many animation action library for developers to use, of course, this is an unfortunate news for the artist, Because of the reusable action library, the art of the task is relatively reduced, so the art of competition in the Unity field will be increased.

Figure 5 Setting up a map to get skeleton information Figure 6 setting muscle to get skin information

Drag and drop the role model that created the Avater into the game scene and open the Animator component interface shown in 7.

Figure 7 Animator Components

In the Animator component interface shown in Figure 7, the developer first needs to create a Animator controller, click the menu asset--create, select the Animator Controller command in the Open menu, 8, and then in Proj A new Animator Controller is created in the ECT pane.

Figure 8 Creating a Animator Controller

Double-click the New Animator Controller to open the Animator state machine Settings screen in the left pane, 9.

Figure 9 Animator state Machine Setup Interface

In the interface shown in Figure 10, find the animation of the person waving, drag and drop it into the Animator state machine, the interface shown in 11 appears.

Figure 10 Selecting Wave Animation

In Figure 11, a yellow rectangular Wave indicates that the character is in the default state.

Figure 11 Drag and Drop wave animation to the Animator window

In Figure 12, select the robot in the scene and drag and drop the New Animator controller into the controller variable of the robot. In this way, the original Dude animation wave movement, binding to the robot, so that the robot also has a wave of action.

Figure 12 Binding animations

Repeat the above steps to bind the other 3 characters so that they also have a waving gesture. Running the game, the 4 characters will all have a waving action, 13 shows.

Figure 13 Implementing a wave animation

The above simply explains how to use the redirection function to set the basic process of character animation.  

About the new animation system in Unity 4.0--mecanim, here is just a brief introduction, because the text is difficult to express these operating procedures, I will soon make a Chinese video lecture, dedicated to the Unity 4.0 in the new animation system--mecanim.  

New animation system in Unity 4.0--mecanim, Chinese video lectures once finished, will be stored in Youku video online, storage address as follows:Http://i.youku.com/Unity3DGAME

New animation system in Unity 4.0--mecanim

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.