Author Topic: FAQ  (Read 63547 times)

echo17

  • Administrator
  • *****
  • Posts: 1096
    • View Profile
FAQ
« on: February 21, 2013, 07:49:27 AM »
Q: I'm having a problem, what is the best way to get help?
A: http://www.echo17.com/forum/index.php?topic=247.msg800#msg800

Q: Is SmoothMoves compatible with Unity 5?
A: http://www.echo17.com/forum/index.php?topic=247.msg2212#msg2212

Q: Does SmoothMoves support Mecanim? Why do I get errors stating that the animation is not retargetable?
A: http://www.echo17.com/forum/index.php?topic=247.msg1909#msg1909

Q: I have set colors on my bones or keyframes, so why is the color not updating when I run the scene?
A: http://www.echo17.com/forum/index.php?topic=247.msg353#msg353

Q: Why are my prefabs not updating? / How do I use BoneAnimations in a prefab?
A: http://www.echo17.com/forum/index.php?topic=247.msg360#msg360

Q: My animation is too big / too small! How do I make it smaller / bigger?
A: http://www.echo17.com/forum/index.php?topic=247.msg346#msg346

Q: How do I make an animation face the other direction?
A: http://www.echo17.com/forum/index.php?topic=247.msg381#msg381

Q: How can I use SmoothMoves with Unity 4.3+ 2D sprites and physics
A: http://www.echo17.com/forum/index.php?topic=247.msg1096#msg1096

Q: How can I set the sorting layer or sorting order of a BoneAnimation?
A: http://www.echo17.com/forum/index.php?topic=247.msg2911#msg2911

Q: How do I extract a Texture2D from a SmoothMoves TextureAtlas?
A:  http://www.echo17.com/forum/index.php?topic=247.msg342#msg342

Q: How do I reference a bone at runtime? / How do I instantiate objects at a bone's location?
A: http://www.echo17.com/forum/index.php?topic=247.msg345#msg345

Q: How do I control bones through code at runtime?
A: www.echo17.com/forum/index.php?topic=247.msg347#msg347

Q: How do I change the speed of my animation at runtime? How do I set the frame?
A: http://www.echo17.com/forum/index.php?topic=247.msg348#msg348

Q: How do I get rid of lines around the edges of my bone's textures? How do I get rid of artifacts / blurriness?
A: http://www.echo17.com/forum/index.php?topic=247.msg349#msg349

Q: Why are my animations not batching? / Why am I getting at least one draw call per animation?
A: http://www.echo17.com/forum/index.php?topic=247.msg351#msg351

Q: Where can I find documentation / video tutorials?
A: http://www.echo17.com/forum/index.php?topic=247.msg352#msg352

Q: How do I share my animations with other people?
A: www.echo17.com/forum/index.php?topic=247.msg354#msg354

Q: Why am I getting errors after importing a new version of SmoothMoves? / Why are there duplicate Dlls? / Why am I not getting the latest version of the plugin?
A: http://www.echo17.com/forum/index.php?topic=247.msg361#msg361

Q: How do I copy / duplicate animation data?
A: http://www.echo17.com/forum/index.php?topic=247.msg366#msg366

Q: Why does my animation keep changing textures even after I start a new animation or cross fade?
A: http://www.echo17.com/forum/index.php?topic=247.msg367#msg367

Q: When I rebuild my atlases, my animation looks messed up. How do I fix this?
A: http://www.echo17.com/forum/index.php?topic=247.msg368#msg368

Q: How do I swap textures in my animation?
A: http://www.echo17.com/forum/index.php?topic=247.msg373#msg373

Q: What platforms are supported?
A: http://www.echo17.com/forum/index.php?topic=247.msg378#msg378

Q: What Unity licenses / versions are supported?
A: http://www.echo17.com/forum/index.php?topic=247.msg379#msg379

Q: Are there any examples of games made with SmoothMoves?
A: http://www.echo17.com/forum/index.php?topic=247.msg380#msg380

Q: How do I change the properties of a sprite at runtime?
A: http://www.echo17.com/forum/index.php?topic=247.msg404#msg404

Q: How do I switch textures for multiple resolutions (SD / HD / Retina / etc)?
A: http://www.echo17.com/forum/index.php?topic=247.msg405#msg405

Q: How do I change a material / shader on my animations?
A: http://www.echo17.com/forum/index.php?topic=247.msg406#msg406

Q: What workflow & Apps do you recommend to create SmoothMoves characters?
A: http://www.echo17.com/forum/index.php?topic=247.msg423#msg423

Q: Why do queued animations not process color?
A: http://www.echo17.com/forum/index.php?topic=247.msg560#msg560

Q: How can I copy keyframe data from one animation to another?
A: http://www.echo17.com/forum/index.php?topic=247.msg564#msg564

Q: How do I use SmoothMoves with Playmaker?
A: http://www.echo17.com/forum/index.php?topic=247.msg565#msg565

Q: How can I anchor bones so that they follow other bones without scaling?
A: www.echo17.com/forum/index.php?topic=247.msg596#msg596

Q: How do I set up my own animation events? How can I set certain frames to trigger external events like playing a sound, etc.?
A: http://www.echo17.com/forum/index.php?topic=247.msg602#msg602

Q: Why am I not getting the same number of draw calls as atlases in my animation? Why are there multiple instances of a material in my Skinned Mesh Renderer?
A: http://www.echo17.com/forum/index.php?topic=247.msg635#msg635

Q: Why are my events not firing on the last frame?
A: http://www.echo17.com/forum/index.php?topic=247.msg636#msg636

Q: I upgraded to Unity 4.2, and now my depths are messed up. What do I do?
A: http://www.echo17.com/forum/index.php?topic=247.msg733#msg733

Q: How can I change my animation curve tangents without selecting each keyframe and changing the tangent?
A: http://www.echo17.com/forum/index.php?topic=247.msg755#msg755

Q: How do I modify the source code?
A: http://www.echo17.com/forum/index.php?topic=247.msg812#msg812

Q: Why isn't the Flash platform supported?
A: http://www.echo17.com/forum/index.php?topic=247.msg819#msg819

Q: I'm using a source control program and my animations are messed up after I backup / restore. What do I do?
A: http://www.echo17.com/forum/index.php?topic=247.msg922#msg922

Q: When I scale my animation, my bones don't resize or move around incorrectly. What is wrong?
A: http://www.echo17.com/forum/index.php?topic=247.msg946#msg946

Q: How do I set up a rig for a character so that I can use the same animations with just different bone offsets for variations of the character?
A: http://www.echo17.com/forum/index.php?topic=247.msg996#msg996

Q: How can I do a mass update to change an atlas in an animation in the editor?
A: http://www.echo17.com/forum/index.php?topic=247.msg1067#msg1067

Q: How do I determine what animation clip(s) are playing?
A: http://www.echo17.com/forum/index.php?topic=247.msg1637#msg1637

Q: How do I fix errors after importing "SmoothMoves_Editor_dll_after4.3" package or after updating to Unity 4.5 or greater?
A: http://www.echo17.com/forum/index.php?topic=247.msg2096#msg2096

Q: If I have multiple animations going, sometimes the events of one animation affect the others. How do I fix this?
A: http://www.echo17.com/forum/index.php?topic=247.msg2106#msg2106

Q: How can I quickly change which properties are copied / pasted in the editor?
A: http://www.echo17.com/forum/index.php?topic=247.msg2139#msg2139

Q: Can I cast shadows with my BoneAnimations?
A: http://www.echo17.com/forum/index.php?topic=247.msg2146#msg2146

Q: Why do duplicated animations all change when I change the color on one animation?
A: http://www.echo17.com/forum/index.php?topic=247.msg2177#msg2177
« Last Edit: February 18, 2015, 06:53:43 AM by echo17 »

echo17

  • Administrator
  • *****
  • Posts: 1096
    • View Profile
Re: FAQ
« Reply #1 on: February 21, 2013, 07:52:24 AM »
Q: How do I extract a Texture2D from a SmoothMoves TextureAtlas?

You can use the following code to extract a 2D texture from a TextureAtlas:

Be sure your atlas' texture is set to "Read/Write Enabled" = true!



Code: [Select]
    using SmoothMoves;

    public Texture2D ExtractTextureFromAtlas(TextureAtlas atlas, string textureName)
    {
        // Before running this, make sure:
        // - your atlas' texture is set to "Read/Write Enabled" = true

        // First, load the atlas texture from the atlas material
        // (you could also reference the material or even the texture to avoid this step)
        Texture2D atlasTexture = (Texture2D)atlas.material.mainTexture;

        // Next, get the source image's index based on the name of the texture.
        // Pull the width and height of the atlas texture
        int sourceImageIndex = atlas.GetTextureIndex(atlas.GetTextureGUIDFromName(textureName));
        int atlasWidth = atlasTexture.width;
        int atlasHeight = atlasTexture.height;

        // Next, get the rect for the uvs of the source image inside the atlas texture
        Rect sourceUV = atlas.uvs[sourceImageIndex];

        // Next, get the size of the source texture from the atlas
        Vector2 sourceSize = atlas.textureSizes[sourceImageIndex];
        int sourceWidth = Mathf.FloorToInt(sourceSize.x);
        int sourceHeight = Mathf.FloorToInt(sourceSize.y);

        // Next, get the pixels from the atlas texture based on the uvs and sizes of the atlas texture
        // and source texture
        Color[] sourcePixels = atlasTexture.GetPixels(Mathf.FloorToInt(sourceUV.xMin * atlasWidth),
                                                        Mathf.FloorToInt(sourceUV.yMin * atlasHeight),
                                                        sourceWidth,
                                                        sourceHeight
                                                      );

        // Next, create a texture component to store the pixels
        Texture2D sourceTexture = new Texture2D(sourceWidth,
                                                sourceHeight,
                                                atlasTexture.format,
                                                false);

        // Next, set the pixels that we extracted from the atlas texture
        // Don't forget to apply!
        sourceTexture.SetPixels(sourcePixels);
        sourceTexture.Apply(false);

        return sourceTexture;
    }


Complete package (right-click and save): http://echo17.com/support/SmoothMoves_ExtractTextureFromAtlas.unitypackage

Note: if all you want to do is swap a texture, you can call one of various swap texture functions in the bone animation. Have a look at this FAQ for more information:

http://www.echo17.com/forum/index.php?topic=247.msg373#msg373
« Last Edit: March 12, 2013, 09:08:28 AM by echo17 »

echo17

  • Administrator
  • *****
  • Posts: 1096
    • View Profile
Re: FAQ
« Reply #2 on: February 21, 2013, 08:01:19 AM »
Q: How do I reference a bone at runtime? / How do I instantiate objects at a bone's location?

The following code is a guideline for referencing bone transforms at runtime and instantiating objects at the transform:

Code: [Select]

private Transform _muzzleTransform;

public SmoothMoves.BoneAnimation boneAnimation;
public GameObject bulletPrefab;

void Awake()
{
    _muzzleTransform = boneAnimation.GetBoneTransform("Muzzle");
}

public void SpawnBullet()
{
    GameObject go = (GameObject)Instantiate(bulletPrefab, Vector3.zero, Quaternion.identity);
    go.transform.position = _muzzleTransform.position;
}


echo17

  • Administrator
  • *****
  • Posts: 1096
    • View Profile
Re: FAQ
« Reply #3 on: February 21, 2013, 08:07:25 AM »
Q: My animation is too big / too small! How do I make it smaller / bigger?

You can set the import scale of the animation data asset. Values smaller than one will make it smaller. Values greater than one will make it bigger.



If you are experiencing unintended results such as bones not the right scale or in the wrong position, please see this FAQ:

http://www.echo17.com/forum/index.php?topic=247.msg946#msg946


For Pixel-Perfect Results:

SmoothMoves creates animations that have 1 pixel = 1 Unity world unit (usually 1 meter). This will make very large animations in a 3D environment, but provide a perfect way to get crisp results in a 2D environment. If you want to have pixel-perfect animations, your camera and animation import scale must be in sync.

If your BoneAnimationData's import scale is set to 1, then your camera's ortho size needs to be half the screen height. For example, if your screen height is 960x640, then your camera's ortho size should be 320. If the import scale is set to something else, say 0.01 (or 1/100), then your camera's ortho size will need to be adjusted to 1/100 of half the screen height, so 640 / 2 / 100 = 3.2.

If you are using Unity sprites, you can adjust your sprite's "Pixel to Units" value to match your SmoothMoves and camera settings. Take a look at the following scenarios:

1) Your screen size is 960x640 and your camera ortho size is 320:

  • SmoothMoves animation import scales should be set to 1
  • Unity sprite Pixels to Units should be set to 1

2) Your screen size is 960x640 and your camera ortho size is 3.2:

  • SmoothMoves animation import scales should be set to 0.01
  • Unity sprite Pixels to Units should be set to 100
« Last Edit: February 23, 2014, 08:32:09 AM by echo17 »

echo17

  • Administrator
  • *****
  • Posts: 1096
    • View Profile
Re: FAQ
« Reply #4 on: February 21, 2013, 08:11:45 AM »
Q: How do I control bones through code at runtime?

You can control your bone transforms in code in the LateUpdate of your script. The LateUpdate will process after Unity has performed its animation functions, so anything you do there will override the animation.

Example code showing how to aim a character's left arm at the mouse:

Code: [Select]

using UnityEngine;
using SmoothMoves;

// simple script to aim a character's left arm at the mouse
public class Aim : MonoBehaviour
{
    // internal variables used to store values so that we don't have allocs at runtime
    private Transform _leftArmTransform;
    private Vector3 _transformScreenPosition;
    private Vector3 _leftArmRotation;
    private Vector3 _mouseOffset;

    // references for the Inspector
    public BoneAnimation boneAnimation;
    public Camera camera;

void Start ()
    {
        // cache our transform for faster processing later
        _leftArmTransform = boneAnimation.GetBoneTransform("Arm L");

        // set the arm rotation to zero
        _leftArmRotation = Vector3.zero;
     
        // play the idle animation
        boneAnimation.Play("Idle");
    }

    void Update ()
    {
        // don't want to override here, Unity's animation will stamp on any changes
    }

    // bone processing goes here, after Unity has made its changes using its animation processes
    void LateUpdate()
    {
        // check to see if the mouse button is down
        if (Input.GetMouseButton(0))
        {
            // set the arm's transform
            SetArm();
        }
    }

    // this function calculates the arm's rotation and sets the arm's bone
    private void SetArm()
    {
        // get the screen position of the arm bone (relative to the camera)
        _transformScreenPosition = camera.WorldToScreenPoint(_leftArmTransform.position);

        // get the offset vector from the arm's screen position to the mouse position
        _mouseOffset = (Input.mousePosition - _transformScreenPosition);

        // calculate the z rotation angle using the tan of y/x
        _leftArmRotation.z = Mathf.Atan2(_mouseOffset.y, _mouseOffset.x) * Mathf.Rad2Deg;

        // set the arm's rotation
        _leftArmTransform.eulerAngles = _leftArmRotation;
    }
}



echo17

  • Administrator
  • *****
  • Posts: 1096
    • View Profile
Re: FAQ
« Reply #5 on: February 21, 2013, 08:16:50 AM »
Q: How do I change the speed of my animation at runtime? How do I set the frame?

Speed

You can adjust the speed of your animation by changing the fps or the speed multiplier.

By FPS:

Code: [Select]
boneAnimation["Run"].fps = 40.0f;
OR

By speed multiplier:

Code: [Select]
boneAnimation["Run"].speed = 0.5f;
FPS (frames per second) is what is set in the editor. Speed multiplier is applying a speed factor to an animation state, where a speed of one is the rate you set in the editor. You can adjust these at any time while running the application.

Frame

You can set the frame of your animation by referencing the frame or frameInt value of your animation state:

Code: [Select]

boneAnimation["Run"].frame = 10.0f;
boneAnimation["Run"].frameInt = 10;

float currentFloatFrame = boneAnimation["Run"].frame;
int currentIntFrame = boneAnimation["Run"].frameInt;

« Last Edit: May 14, 2013, 10:41:06 AM by echo17 »

echo17

  • Administrator
  • *****
  • Posts: 1096
    • View Profile
Re: FAQ
« Reply #6 on: February 21, 2013, 08:31:14 AM »
Q: How do I get rid of lines around the edges of my bone's textures? How do I get rid of artifacts / blurriness?

There are several factors that can cause artifacts to appear in your animations. Any one of these may be the reason, but not necessarily all of them:

Note: #1 through #4 applies to the atlas texture, not the bone source textures

1) Make sure "Generate Mip Maps" is set to off. Mip maps cause blurriness in 2D images and are rarely needed in a 2D game.

2) Check your wrap mode. Sometimes not having "Clamp" on will cause the edge of the other side of the texture to wrap around, making lines.

3) Check your filter mode. Sometimes not having "Point" filtering will cause bleeding in your images. Bilinear is usually okay and gives a softer look to your animations, and works well on perspective cameras. Point filtering has a harder edge and works better with orthographic cameras with pixel-perfect settings.

4) Check your image format. If you have compression set on an iOS device it will be very blurry. Also, if you have a low bit format, you will notice blocking in your gradients (non-smooth transition of colors). If possible, try to use a high bit, non-compressed format for the crispest results.



5) If your source images don't have an alpha channel explicitly defined or you haven't filled out the RGB portions of your image, you may get a white halo around your textures. Have a look at these links on how to fix this:

http://forum.unity3d.com/threads/60508-Photoshop-Files-Give-White-Outline-on-Transparent-Textures

Solidifying Transparent Textures


6) If you are using compression, this can make your textures "bleed" into other textures since they all share the same atlas. You can sometimes get around the bleeding by increasing the padding in your atlas:

« Last Edit: November 01, 2013, 12:30:38 PM by echo17 »

echo17

  • Administrator
  • *****
  • Posts: 1096
    • View Profile
Re: FAQ
« Reply #7 on: February 21, 2013, 08:36:36 AM »
Q: Why are my animations not batching? / Why am I getting at least one draw call per animation?

SmoothMoves generates a skinned mesh that Unity can read and animate. Unfortunately, at this time Unity does not batch skinned meshes. This is probably due to the overhead required to calculate and copy all the transformed vertices of a skinned mesh. The overhead is likely more costly than just performing another draw call in most cases.

echo17

  • Administrator
  • *****
  • Posts: 1096
    • View Profile
Re: FAQ
« Reply #8 on: February 21, 2013, 08:38:16 AM »
Q: Where can I find documentation / video tutorials?

The SmoothMoves website has links to the user guide, API documentation, user videos, and more:

http://echo17.com/smoothmoves.html

echo17

  • Administrator
  • *****
  • Posts: 1096
    • View Profile
Re: FAQ
« Reply #9 on: February 21, 2013, 08:43:03 AM »
Q: I have set colors on my bones or keyframes, so why is the color not updating when I run the scene?

By default, your bone animations are set to NOT process color animations. This is because color blending can be costly, especially on mobile devices. If you want to enable color processing, be sure the "Update Colors" checkbox on your bone animation is toggled to true.

« Last Edit: March 11, 2013, 06:26:53 AM by echo17 »

echo17

  • Administrator
  • *****
  • Posts: 1096
    • View Profile
Re: FAQ
« Reply #10 on: February 21, 2013, 08:53:05 AM »
Q: How do I share my animations with other people?

You can use Unity's packaging process to bundle up your assets that can then be imported into another Unity project.

To package files, select them in the project window and go to the Unity menu: "Assets > Export Package...". You can then save the package file somewhere.



To import the package into a new project, go to the Unity menu: "Assets > Import Package > Custom Package...". You can then select the items from the package to import.



The following assets need to be packaged together:

  • Animation Data
  • Texture Atlas(es)
  • Material(s) referenced by the texture atlas(es)
  • Texture(s) referenced by the material(s)

Optional:

  • Bone animation(s) and prefab(s)
  • Source textures for the atlas(es). This is necessary if you will be editing the animation in the new project.
  • SmoothMoves_Runtime.dll if the other person does not have a copy of SmoothMoves

Never package SmoothMoves_Editor.dll! If the other person does not have this, then they do not own a copy of SmoothMoves. Only the SmoothMoves_Runtime.dll may be redistributed.


Alternative method of sharing:

You can also zip up your entire Unity project and share that with other people. This will ensure the links are intact between all your assets since it includes the Unity project database.
« Last Edit: March 07, 2013, 12:09:24 PM by echo17 »

echo17

  • Administrator
  • *****
  • Posts: 1096
    • View Profile
Re: FAQ
« Reply #11 on: February 21, 2013, 12:10:15 PM »
Q: Why are my prefabs not updating? / How do I use BoneAnimations in a prefab?

Unity does not currently have support for updating nested prefabs. So if you have a prefab nested within another prefab, the updates to your child prefab will not propagate to the nested prefab. Have a look at these links for more information:

http://stackoverflow.com/questions/18768013/what-is-a-nested-prefab
http://answers.unity3d.com/questions/459694/updating-prefabs-within-other-prefabs-nested.html
http://answers.unity3d.com/questions/320934/workarounds-for-nested-prefabs.html

Possible Solution (not endorsed or tested by me): https://www.assetstore.unity3d.com/#/content/2962

Unity does not allow traversal of the prefab hierarchy, so anything below the root level of a prefab is effectively "invisible" to SmoothMoves. Rather than instantiate every prefab in the project on the off chance it contains an animation, SmoothMoves will just look at the root level and rebuild the animations it finds there.

This means that you should have a separate prefab for every animation prefab. Animation prefabs should not be nested in a prefab's hierarchy.

In order to get around this limitation and have child objects of a prefab contain animations you can do the following:

  • Create prefabs for each of your child animations, one animation per prefab
  • Create your parent prefab
  • Link your child prefabs to your parent prefab
  • At runtime, when you instantiate your parent prefab, have your parent prefab in turn instantiate and attach its child animation prefabs

Example from "Rise of the Dough":

The Pizza prefab (parent) does not contain any BoneAnimations in it. It contains the logic, a collider child, and a grease particle system. It does, however, contain a reference to the Pizza animation prefab. The Pizza animation prefab has only a BoneAnimation component and nothing else.



At runtime, the Pizza prefab is instantiated. Within the Pasta.cs script, in the initialization code, the Pizza gameobject will instantiate the Pizza animation and attach it (The Initialize function is called after instantiating the Pizza gameobject):

Only relevant code shown

Code: [Select]

    using SmoothMoves;

    private BoneAnimation _liveAnimation;

    public GameObject liveAnimationPrefab;

    public void Initialize(GameManager manager)
    {
        // instantiate the live animation
        GameObject go;
        go = (GameObject)Instantiate(liveAnimationPrefab, Vector3.zero, Quaternion.identity);
        go.transform.parent = gameObject.transform;
        _liveAnimation = go.GetComponent<BoneAnimation>();
    }


The final, in-game result is a gameobject with a child animation:



For more information, check out the video tutorial here:

Prefabs


« Last Edit: February 25, 2014, 01:22:05 PM by echo17 »

echo17

  • Administrator
  • *****
  • Posts: 1096
    • View Profile
Re: FAQ
« Reply #12 on: February 22, 2013, 08:32:55 AM »
Q: Why am I getting errors after importing a new version of SmoothMoves? / Why are there duplicate Dlls? / Why am I not getting the latest version of the plugin?

Unity sometimes has difficulty seeing that files already exist when importing packages. This can lead to duplicate instances of the files, and often times, errors after importing:



To get around the import limitations, do the following upgrade process whenever you import a new plugin (this is useful for ALL plugins):

  • Back up your work!!!
  • Create a new, empty project
  • Download and import the plugin into your new project
  • Close Unity
  • Using your OS' file system, delete the old files in the plugins folder of your existing project
  • Using your OS' file system, copy the imported plugin files from your new project to your existing project
  • Open your existing project in Unity and right-click on the plugin's folder. Select "Reimport"



If you are still not getting the latest version of the plugin, this may be caused by a bug in the Unity asset store that will sometimes not download the latest copy of a plugin, but instead just pulls from the already downloaded assets. To get around this:

  • Click on the down arrow next to the "Import" button in the Asset Store
  • Select "Redownload and Import"



Follow the upgrade steps above.

After upgrading, be sure to rebuild your animations since data structures may have changed since the last update.
« Last Edit: October 30, 2013, 11:17:30 AM by echo17 »

echo17

  • Administrator
  • *****
  • Posts: 1096
    • View Profile
Re: FAQ
« Reply #13 on: February 28, 2013, 06:40:36 AM »
Q: How do I copy / duplicate animation data?

You can copy your animation data in its entirety by selecting the animation data and going to the Unity menu "Edit > Duplicate". Ctrl + D is also the keyboard shortcut for this command.



echo17

  • Administrator
  • *****
  • Posts: 1096
    • View Profile
Re: FAQ
« Reply #14 on: March 01, 2013, 12:46:07 PM »
Q: Why does my animation keep changing textures even after I start a new animation or cross fade?

This can be caused by several different things, depending upon how your animations are structured.  Triggers, such as texture changes are fired when a clip is playing. If you have multiple clips playing at the same time (fading, blending, mixing), then you could have triggers competing with each other from all the playing clips.

Some things you can do to resolve this:

1) Explicitly stop an animation before playing a new one

Code: [Select]

SmoothMoves.BoneAnimation boneAnimation;

boneAnimation.Stop("Running");
boneAnimation.Play("Standing");


2) Fading between animations can be tricky if your character is changing poses or bones are being rotated / scaled. Sometimes it is best to have intermediate animations to transition between your main animations. When using intermediate animations, you would not fade, but just play each in sequence. Have a look at this video for an example:

Crossfading and Intermediate Animations


3) If you are mixing an animation, then the last texture trigger may linger around until your base animation has fired another trigger. In this instance, you'll need to play another mixed animation at the same layer as your last mixed animation with one keyframe to set the texture to something else.