Animation
Material Animation#
This sample demonstrates animating materials using material animation objects. It is useful for implementing dynamic changes in properties of materials in real time.
This is especially useful for scenes where object properties need to change based on user actions or world events, such as weather or time of day changes.
SDK Path: <SDK_INSTALLATION>source/animation/animation_material
Node Animation#
This sample demonstrates animating nodes using node animation objects. It will be helpful for creating complex animation scenarios for stage objects in real time.
Node animations can serve as a foundation for various effects, including element appearance/disappearance, rotations, resizing, and more.
SDK Path: <SDK_INSTALLATION>source/animation/animation_node
Playback Layers#
This sample demonstrates the use of animation layers to create and play object animations. The code shows how you can combine different animation tracks and play them simultaneously or sequentially.
SDK Path: <SDK_INSTALLATION>source/animation/playback_layers
Property Animation#
This sample demonstrates animating property parameters using property parameter animation objects. Useful for implementing custom effects that depend on property parameters.
SDK Path: <SDK_INSTALLATION>source/animation/animation_property
Singleton Animation#
This sample demonstrates animating global engine parameters using singleton animation modifiers.
Animation modifiers give you programmatic control over scene effects, weather changes, time transitions, and the animation of physical properties, resulting in more engaging and interactive scenes.
All of the animation tracks, playbacks and objects are managed by the animation system and have the "engine lifetime", i.e. they exist from the point they're loaded or created to when the engine shutdowns, and therefore are preserved between different worlds.
You have to stop active playbacks when switching to another world, if you don't want them continue playing there.
SDK Path: <SDK_INSTALLATION>source/animation/animation_singleton
Widget Animation#
This example shows how to animate widgets using runtime animation objects.
It demonstrates how to control and animate interface elements programmatically. Using dynamic animations helps create more lively, appealing user interfaces and enables automation of their behavior.
SDK Path: <SDK_INSTALLATION>source/animation/animation_widget
Bones Constraints#
This sample demonstrates the use of bone rotation constraints and illustrates how they affect the operation of inverse kinematics.
This demonstrates how to create an IK chain for a character's bones, set a target position, and automatically control the bones' movement to produce realistic poses. A target is an object that updates dynamically according to the player's camera position.
SDK Path: <SDK_INSTALLATION>source/animation/bones_constraints
Bones IK#
This sample demonstrates how to control bones using inverse kinematics
The pole vector is used as a constraint that defines the plane of joint bending.
The example is useful for creating animations where character bones are automatically positioned and oriented to achieve realistic movement.
SDK Path: <SDK_INSTALLATION>source/animation/bones_ik
Bones LookAt#
This sample demonstrates the use of LookAt chains for aiming at a target.
The chain contains the spine and head bones. By setting different weights for each bone you can adjust the targeting effect. The constraint is represented by a pole vector that defines a plane for the upward direction of each bone.
LookAt chains enable interactive control over the position and orientation of a character's eyes, head, shoulders, and other body parts. This is useful for animating the game environment in various situations.
SDK Path: <SDK_INSTALLATION>source/animation/bones_look_at
Bones Masks#
This sample demonstrates how to use bone masks.
Masks enable complex animation combinations. For example, you can preserve the original body movements while limiting head or arm animations to rotation, or scaling specific bones.
This method is excellent for multi-layered animations, allowing you to mix motions, add effects, or exclude certain parts of the model to achieve specific visual results or behaviors.
SDK Path: <SDK_INSTALLATION>source/animation/bones_masks
Bones Retargeting#
This sample demonstrates how the same animation can be used on skeletons with different proportions.
The pair on the left represents the use of animation without retargeting. On the right, the animatiotion is retargeted from the adult to the child. The bone length ratio between skeletons is taken into account for adjustment of the position component.
Retargeting is useful when you need to use the same animation source for different characters or objects with varying proportions but similar skeletal structures. This approach significantly speeds up the process of preparing animations.
SDK Path: <SDK_INSTALLATION>source/animation/bones_retargeting
Bone Root Motion#
This sample demonstrates the implementation of the root motion technique.
On the left there is a common looping animation. On the right, the offset of the root bone moves the object itself.
Root motion is particularly valuable for realistic character, vehicle, or object movements in games and simulations.
SDK Path: <SDK_INSTALLATION>source/animation/bones_root_motion
Bones Sandbox#
This sample provides the interface that allows visualizing and experiencing how to configure all available settings for IK chains, LookAt chains, and bone rotation constraints.
SDK Path: <SDK_INSTALLATION>source/animation/bones_sandbox
Bones Simple Foot Placement#
This sample demonstrates a naive option for placing feet on a surface using IK chains.
Raycasting is applied to detect surface contact: in each frame, a ray is cast downward from the foot position to find intersections with the surface. The resulting contact point and surface normal are then used to adjust the foot bones' position and orientation, ensuring realistic foot placement.
SDK Path: <SDK_INSTALLATION>source/animation/bones_simple_foot_placement
Bones State Machine#
This sample demonstrates how to make an animated state machine based on ObjectMeshSkinned.
A state machine is a design pattern that manages various object states—such as idle, walking, or sneaking—and handles transitions between them. The example illustrates how to configure state machines with dynamic controls for walking, turning when idle, and running.
Implementing state machines enables the creation of complex, flexible character behaviors.
SDK Path: <SDK_INSTALLATION>source/animation/bones_state_machine
Curve Animation#
This sample demonstrates sample shows how to animate objects using Curve2D: moving platforms, rotating coins, and a heart changing its size.
SDK Path: <SDK_INSTALLATION>source/animation/curve_animation
Physics-Based Animation#
This sample shows implementation of physics-based animation for the cat's movements in a simple game where a cat chases a laser pointer (different easing functions are used).
SDK Path: <SDK_INSTALLATION>source/animation/physics_based_animation
Track Playback#
Sample demonstrating how to use Tracker to animate objects (change their position, rotation, and scale) based on tracks created in the Tracker tool.
Tracker comes in handy for creating complex animation scripts.
SDK Path: <SDK_INSTALLATION>source/animation/track_playback
The information on this page is valid for UNIGINE 2.20 SDK.