Getting Started
Prerequisites
To work with Rukhanka Animation System you need following:
- Unity 2022.3.0f1+
- Unity
Entities
package version 1.0.16 (installed automatically as dependency) - Unity
Entities.Graphics
package version 1.0.16 (installed automatically as dependency) - HDRP or URP as required by
Entities.Graphics
package - [Optional]
Netcode for Entities
package for network animation synchronization support
Animated Object Setup
To make animations work correctly there are some preparation setup steps are required.
Model Importer
Use standard Unity model importer configuration page to setup required model properties:
-
Uncheck
Optimize Game Objects
checkbox. Rukhanka need all bone game objects in baking phase.
Rig Definition
Rukhanka can get all required information about skeleton rig structure from Unity Avatar
. There are several required simple steps to populate Unity Avatar
with all necessary rig data:
-
In the importer window of your animated model switch
Animation Type
to theHumanoid
and pressApply
.ImportantYou must do this for every model (even
Generic
). By switching to theHumanoid
animation type Unity generates publicly available information about the skeleton rig structure that Rukhanka reads.You will get an error during the baking process if avatar rig information is not available to Rukhanka.
-
For
Humanoid
models configuration process is ended already. ForGeneric
models you need to switchAnimation Type
of model back toGeneric
and pressApply
.
Authoring Object Setup
Final step is to create authoring GameObject
inside Entities
Subscene
-
Place your animated object inside
Entities
Subscene. For detailed description of this step refer Entites Package documentation. -
Add
Rig Definition Authoring
component to newly created object. Make sure thatRig Config Source
is set toFrom Animator
. -
Create standard
Animator Controller
and fill it as you wish (one state with one animation will be a good start). -
Switch culling mode to
Always Animate
.
Shaders And Materials
Rukhanka does not render animated objects. It only prepares skin matrices for skinned meshes that are processed by Rukhanka Deformation System
(or by Entities.Graphics
package if RUKHANKA_NO_DEFORMATION_SYSTEM
script symbol defined). To be able to render deformed meshes correctly it is required to make Entities.Graphics
compatible deformation-aware shader. Read carefully Mesh deformations section of Entities.Graphics
package documentation. Make compatible shader using Unity Shader Graph
or Amplify Shader Editor
as described in the Shaders with Deformation page of this manual. Make and assign all required materials to your animated model.
End Of Setup Process
That's all needed to make Rukhanka be able to convert Animator Controller
, all required Animations
and own Rig Definition
into internal structures. After that runtime systems will simulate state machine behaviour and play required animations.
IMPORTANT: There is not 100% Unity's Mecanim
feature support. Please consult Feature Support Tables for complete information.