Skip to main content

Random Player

Last Updated Time: 09/08/2023

Overview

Random Player nodes can select some animation assets for random play.

Creating Random Player Nodes

Right-click on the blank space in the editing area to open the Node Selection panel in Anim Tree Editor. Expand Misc., and select Random Player to create a Random Player node.

image-20230504111234531

After creation:

image-20230504111655448

Properties

Select the Random Player node, and various properties of this node can be seen in the Property Window.

image-20230504162538336

PropertyDescription
Shuffle ModeIf checked, each animation will be randomly played without repeating, and the Chance To Play will be invalid at this time; if not checked, it will be played randomly.
Array ElementClick the "+" button to increase the shuffle array; click the "-" button to decrease the shuffle array.
Asset NameSelect the name of the animation asset.
PreloadWhether to preload the animations.
Chance To PlayThe chance to play the animation.
Min Loop CountThe minimum number of loops to play each time the animation is played.
Max Loop CountThe maximum number of loops to play each time the animation is played.
Min Play RateThe minimum play rate of the animation.
Max Play RateThe maximum play rate of the animation.
Blend TimeAnimation blend in and out time.
Blend ModeThere are 14 optional modes as follows:
  • Linear Interpolation
  • Cubic Interpolation
  • Hermite Cubic Interpolation
  • Sinusoidal Interpolation
  • Quadratic Ease In Out Interpolation
  • Cubic Ease In Out Interpolation
  • Quartic Ease In Out Interpolation
  • Quintic Ease In Out Interpolation
  • Loop Ease In Interpolation
  • Loop Ease Out Interpolation
  • Loop Ease In Out Interpolation
  • Exponential Ease In Interpolation
  • Exponential Ease Out Interpolation
  • Exponential Ease In Out Interpolation

Example

Here is an example demonstrating the features of the Random Player.

Creating Characters

Refer to the documentations Assembling Actors and Animation Trees to create a Character and an Animation Tree.

image-20230504133027406

Configuring Animation Trees

Add a Random Player node and link it to the Final Animation Pose node in the Anim Tree Editor.

image-20230504133846067

Select the Random Player node and set its properties in the Property Window. Click the image-20230504134118644 button to create two Array Elements. Set the Asset Names of them respectively, and select two different animation assets. Other related properties can be modified as needed.

image-20230504162711364

Click the Apply button to see the character play randomly between the two animations.

Apply