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:
- Create a new scene by right clicking in the Project window and selecting Create/Scene.
- 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/Low Poly Man/LowPolyMan.fbx.
- Disable the
Apply Root Motiontoggle on the character's
Animatorcomponent. Most examples won't involve any root motion and those that do will tell you to re-enable it.
- Select the character and click the Add Component button at the bottom of the Inspector then start typing
AnimancerComponentand click on that component when it appears in the list.
- Select the Main Camera and reposition it to better view the character. For the LowPolyMan 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 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.
If you want a ground plane:
- Right click in the Hierarchy window and create a 3D Object/Plane.
- Reset its Transform position to
- Go to its
MeshRenderercomponent 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.
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 slider in the Inspector:
- -1 = No button. Always rotate with mouse movement.
- 0 = Left Click.
- 1 = Right Click (default).
- 2 = Middle Click.
Remember to exit Play Mode after you are done looking.
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.
Many of the Animancer examples use UI
Buttons to call methods (to run some code). They are fairly easy to set up like so:
- 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).
- Go to the
On Clickevent of the
Buttoncomponent and use the
+button to add a new function to call.
- Drag the object you want to call a function on from the Hierarchy window into the object reference field of the new function.
- Use the dropdown menu to select the method you want to call.
Button will then call that method at runtime when it is clicked.