Debugging

Animation management is a fairly complex subject which unfortunately means there are a wide variety of different problems that you might encounter when working with them, so this page explains how to identify and resolve them.

Debuggers and Logging

Debuggers and Logging are extremely useful tools for finding the cause of any issues so that you can fix them. For example:

  • If an animation isn't playing, you could call Debug.Log("Playing Animation"); near where you are telling it to play to make sure that function is actually getting executed.
  • If you want to find out what animation is currently playing, you can call Debug.Log(animancer.States.Current); (or select the object and have a look at it in the Inspector.

Inspector

In Play Mode, you can select an object with an AnimancerComponent and use the Inspector to examine the current Animation Details of all the states it manages in real-time.

Rig Types

If a character with a Generic Rig is not playing any animation it will simply not move, but if a Humanoid Rig is not playing any animation it will go into a "compressed" or "hunched over" pose according to the muscle limits defined in the Avatar configuration (pictured to the right). One of the most common reasons for this to happen is if you accidentally try to play a Generic animation on a Humanoid Rig (or vice-versa). Both the model and animations must use the same Rig type.

The Animation Types section explains the potential incompatibilities between models and animations in more detail.

Other

  • If an animation is not playing properly, it may be worth trying it in a regular Animator Controller to determine whether the problem is caused by Animancer or something else.
  • If you encounter an issue that only occurs in runtime builds, you can enable the Development Build option in the Build Settings window so that Animancer will include various debug assertions (additional error checking with more descriptive messages) which are normally only active in the Unity Editor.
  • If you think there may be a bug relating to the ObjectPool system, you can make it log various usage events by going to Edit -> Project Settings -> Player -> Other Settings -> Scripting Define Symbols and adding ANIMANCER_LOG_OBJECT_POOLING to that field. This only works with Animancer Pro.

Reproducible Example

If you still can't track down the cause of a problem, the Help page lists several contact methods you can use to get help with your specific issue.

When asking for help, it is important to actually describe the problem. Simply saying "It doesn't work" isn't descriptive enough to help people understand your problem. You need to explain what you expected to happen and how that is different from what is actually happening.

People will be better able to provide help if you provide code (and any other necessary assets) that they can use to reproduce the problem. Your goal is to narrow down the minimum necessary files for someone else to see what is wrong, which is usually easiest to do by starting a new project and adding the parts you think you need until it can demonstrate the problem.

Once you have determined which assets you need, you can select them in Unity's Project window and use the Assets -> Export Package... menu function to open a window where you can select which assets to export. If you are going to email the package to animancer@kybernetik.com.au then you can simply include all the necessary assets, but you MUST NOT include Animancer in the package if you are going to post it anywhere public such as a Github Issue or Forum (simply untick the Assets/Plugins/Animancer folder in the Exporting package window so that anyone who downloads it will need to import Animancer separately).