Basic Scene Setup

This page explains how to create a new scene with a character in it to use as a starting point for many of the example tutorials.

The required steps are quite simple:

  1. Create a new scene by right clicking in the Project window and selecting Create/Scene.
  2. Drag the desired character model into the Hierarchy window and position it at the origin (0,0,0). Practically any character will work if you have animations for them, or you can use the standard character included with Animancer which is located at Assets/Plugins/Animancer/Examples/Art/Default Humanoid/DefaultHumanoid.fbx.
  3. Disable the Apply Root Motion toggle on the character's Animator component. Most examples won't involve any root motion and those that do will tell you to re-enable it.
  4. Select the character and click the Add Component button at the bottom of the Inspector then start typing AnimancerComponent and click on that component when it appears in the list.
  5. Select the Main Camera and reposition it to better view the character. For the DefaultHumanoid model, (2,1,-1) is a good position with (0,-60,0) as the rotation.

Click here if you are wondering why the Transform Inspector looks different from Unity's default in that image.

It's because of a plugin called Inspector Gadgets (also made by Kybernetik like Animancer).

It replaces the default Transform Inspector to add features like the [C][P][S] buttons on the right to Copy and Paste values between objects, and Snap them to the grid or the [=] button on the left which toggles the Scale field from a single value to the regular x/y/z vector field.

Inspector Gadgets Pro adds many more features, but the enhanced Transform Inspector is included in the Lite version for free.

Ground Plane

If you want a ground plane:

  1. Right click in the Hierarchy window and create a 3D Object/Plane.
  2. Reset its Transform position to (0,0,0).
  3. Go to its MeshRenderer component and change the material to Stone-Light.

There are also a few optional scripts located in Assets/Plugins/Animancer/Examples/Code which can be useful.

Orbit Controls

Most of the examples can be viewed fine from a fixed camera angle, but if you add the OrbitControls script to the Main Camera it will allow you to rotate the camera around a Focal Point point by holding Right Click and dragging the mouse. You can also scroll to zoom in and out.

Right Click was chosen as the default to avoid interfering with any examples where you need to Left Click on buttons or anything else, but you can easily change it via the Mouse Button field in the Inspector.

Remember to exit Play Mode after you are done looking.

Time Scale

The TimeScale script can be added to anything in the scene to give you a slider in the Inspector which controls how fast the game runs. This can be very useful for observing transitions and other events in slow motion.

Buttons

Many of the Animancer examples use UI Buttons to call methods (to run some code). They are fairly easy to set up like so:

  1. Right click in the Hierarchy window and create a new UI/Button. This creates the Button as a child of the Canvas (and creates a Canvas and Event System if they did not already exist).
  2. Go to the On Click event of the Button component and use the + button to add a new function to call.
  3. Drag the object you want to call a function on from the Hierarchy window into the object reference field of the new function.
  4. Use the dropdown menu to select the method you want to call.

The Button will then call that method at runtime when it is clicked.

Note that the On Click event in Unity's Button script is a UnityEvent Field.