Samples
Installation
Rukhanka's Package Manager
description window has samples tab. Clicking on Import
button will add Rukhanka samples in project folder under Assets/Rukhanka Animation System/<version>/. Navigate to the scenes subfolder for individual samples.
Basic Animation
This sample is a result of the Getting Started page of this documentation. The sample scene contains several models that play one animation each.
Bone Attachment
Entities (animated and non-animated) are handled by Rukhanka automatically. No extra special steps are needed. Just place your object as a child of the required bone GameObject
. Entity hierarchy will stay intact, but Rukhanka will move corresponding Entities
according to animations. This sample shows this functionality.
Animator Parameters
This sample has an animated model with a simple Animator
created for it. Parameters that control Animator
behavior are controlled by a simple system through UI. Controlling animator parameters from code described in Animator Parameters section of this documentation
BlendTree Showcase
Rukhanka supports all types of blend trees that Unity Mecanim
does. This sample shows Direct
, 1D
, 2D Simple Directional
, 2D Freeform Directional
, 2D Freeform Cartesian
blend tree types. Blend tree blend values can be controlled from in-game UI.
Avatar Mask
Avatar Masks is supported for generic and humanoid animations. The use of this feature is no different than in Unity
. Specify Avatar Mask
and use it in Unity Animator
to mask animation for bones. Rukhanka converts it into internal representation during the baking phase. This sample shows this functionality.
Multiple Blend Layers
Rukhanka has multiple animation layers support. Additive
and Override
layers with corresponding weights are correctly handled by Rukhanka runtime. In this sample, Animator
simulates two layers represented by simple state machines.
User Curves
Custom animation curves are handled the exactly same way as they do in Unity Mecanim
. If the animation state machine has a parameter with a name equal to the animation curve name then the value of the calculated curve at a given animation time will be copied into the parameter value. In this sample, there is an animation that has a curve whose name is the same as the animation speed parameter of the Animator
state machine. This way animation controls its own speed. User curves are described in more detail in the User Curves section of the documentation.
Root motion
Rukhanka has limited Root Motion
support. This sample demonstrates its use case. Root Motion features are described in detail in the corresponding section of documentation.
Animator Override Controller
Unity Animator
has a feature called Animtor Override Controller. This feature enables to use of a different set of animations for a given preconfigured Animator
. This feature is also supported by Rukhanka. This sample has an Animator Controller
and corresponding Animator Override Controller
which overrides several animations.
Non-Skinned Mesh Animation
Rukhanka can animate arbitrary Entity
hierarchy with user-defined animation. This sample shows this use case. Refer to the Non-skinned Meshes page for a detailed description of this feature.
Crowd
This sample shows Rukhanka ability to animate a big number of different animated models. A simple prefab spawner system is used to spawn big counts of prebaked animated prefabs.
Stress Test
This sample is basically the same as the Crowd
sample but with all skinned mesh models replaced by plain cubes. This step removes the big graphics pipeline pressure of the Crowd
scene and keeps only raw Rukhanka animation system performance. This sample scene can be used for checking animation performance limits for tested systems/hardware.
Netcode Demo
Netcode demo is made for showing Rukhanka ability to work with the Unity Netcode for Entities
package to achieve client-server animation synchronization in a network game. The RUKHANKA_WITH_NETCODE
script symbol should be defined for proper demo functionality.
Three types of objects that can be instantiated on the scene:
-
Local client only. Those prefabs exist only in the client world and therefore not synchronized between client and server. To spawn such objects use the
Spawn Local
button. Client-only prefabs have a default coloring scheme to distinguish them: -
Interpolated ghosts. They are colored with red-tinted materials:
-
Predicted ghosts. They are colored with green-tinted materials:
Both network synchronized prefab types can be created by pressing the Spawn Networked
button:
After this demo scene has been started both client and server worlds are created and the client automatically connects to the server. To observe interpolation and prediction behavior it is advised to use PlayMode Tools
of the Netcode
package. By simulating various packet loss and RTT conditions, differences between ghost modes can be observed in this sample.
To even better experience you can make a build with this scene, run it and then connect with another client instance directly from the editor by modifying the play mode type in PlayMode Tools
. Use IP address 127.0.0.1 (localhost) and port 7979:
Using this test environment you can spawn networked prefabs from both of the clients and watch how they are replicated by the server.
Animator State Query
This sample shows the usage of the runtime animator query aspect. Every frame animator queried for its runtime state and transition and received information shown in scene UI.
Humanoid Animations
This sample shows humanoid avatar and animations usage. It has several controls that can be used to alter animation state machines and watch animation changes for sample models.
Simple Physics
Staring from v1.4.0 Rukhanka has an ability to work with unparented (flat) bone hierarchies. This allows to properly attach the Unity.Physics
bodies to the Rukhanka skeleton bones. This sample shows described functionality.
Ragdoll
Bone entities can drive animated bone placement in animation rig. Ragdoll sample have very simple preconfigured physics ragdoll. When animations are not played for animated entity, physics simulation will drive animated bone positions.
Animation and Animator Events
This sample shows a usage example of animation and animator controller events - the new feature of v1.5.0. A simple system reacts to animation events and spawns indicator particles. In reaction to controller events particle color will be changed.
Inverse Kinematics
Various IK algorithms, that are available in Rukhanka distribution, are presented in this sample.
Animation Culling
This sample shows Rukhanka's ability to skip animation processing for invisible entities. Skinned mesh renderer bounding box recalculation is also presented in this demo.
Scripted Controller
Rukhanka can work without the Mecanim
animator controller. In such cases, manual animation submission from code is required. This sample shows manual animation submission and animation parameters manipulation.
Blend Shapes
Rukhanka can animate arbitrary floating point values. If the animated value is blend shape weight for a particular skinned mesh renderer, then this value will be propagated to the corresponding Entities.Graphics
BlendShapeWeight
component. This sample shows this functionality.