Unity3d Animated Script Animation Scripting (Learn more about how animation works in the game engine)

Source: Internet
Author: User
Perhaps the content of this article is a bit dull, but I would like to say that if you want to learn more about how the game engine is dealing with animation breaks or footage and the player's manipulated characters to animate, then this is a good article (of course I just translated it)

animated script Animation Scripting

The Unity ' s animation system allows you to create a nice animated skinning character. Animation system support Animation fusion, mixing, adding animation, pace cycle time synchronization. Animation layer. Control all aspects of animation playback (time, speed, mix weights) Each vertex has 1.2.4 Bone-affected mesh, a physical-system-based ragdoll system, and a program animation. For best results It is recommended that you read the Modeling Optimized characters chapter before making the model and animation bindings.

The production of an animated character mainly consists of two aspects; Moving in the world and the resulting animation.   If you want to know more about character movement, see Character Controller page. The character animation is actually done by the Unity's scripting interface.

You can download the pre-set animated characters in example demos. When you finish the basic section of this page you can also take a look at animation script interface.

If you want, you can click and quickly go to the following topics:

· Animation Blending Animation Fusion

· Animation Layers Animation Layer

· Animation Mixing Animation Mix

· Additive Animation Additional animations

· Procedural Animation Program Animation

· Animation Playback and sampling animation replay and sampling


Animation Blending Animation Fusion

In today's game Animation blending is a basic feature that ensures a smooth transition of game animations . Animations created by animators such as: Walk Loop, run loop, idle in-place animation or shooting animations. At any point in the game you are likely to switch from idle to walking and vice versa. Of course you don't want two different actions to jump suddenly, you need to animate smooth transitions.

And the solution to this problem relies on animation fusion technology. In unity you can have any number of animations for the same character. All of these animation blends are added as a total animation.

First, let's add two animations for a character to stand and walk around in the same place and smooth the transition of these two animations. To make our script easier, we first set the Wrap Mode of the animation to Loop. Then close the play automatically to let our script play exclusively with the animation.

Our first animated script was simple; We need some way to discover how quickly a character moves and then fade in and out between walking and standing. In this simple test we use pre-setup input axes.

function Update () {

if (Input.getaxis ("Vertical") > 0.2)

Animation. Crossfade ("Walk");

Else

Animation. Crossfade ("idle");

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.