Thomas Winged

Animating Rigid Objects


During the development of the adaptation of Wheel of Fortune in Unreal Engine, I came across a seemingly trivial question - how to animate rigid non-character actors to create the most pleasant and graphical workflow possible. In this case, it concerned the introduction of movement and additional visual effects to the cube's rotation, a component of the Word Puzzle Board.


The desired effect - animating rigid objects

To control the block's material, I created two following material blueprints. The first one, MF_ChooseLetter is for selecting a letter from a texture atlas. Essential parameters for manipulations here are Letter Index, Letter Opacity, and Letter Tint:


MF_ChooseLetter - the material function manipulating the cube's face letter

And the second one, the master material for the toy cube, contains a control for Block Tint and Emissiveness. The latter one in combination with BlackBody modifier will be used to create a glow effect:


M_ToyLetterBlock - the toy block's master material

Given this setup, let's move forward and try different methods of animating this actor. I came up with three different ways of achieving this effect.

Pure Blueprint

The first and most obvious is to use timeline components and curves to interpolate parameters. To animate the actor as shown before, I created three curves - one for emissiveness control, one for rotation, and one for letter opacity. And of course, one timeline to combine them.


BP_PuzzleBlock_Toy - initialized components and variables of the actor

This flow does not seem very comfortable, as each timeline is displayed in a separate floating window, and there is no way I know to line them up in a single graph. But still, it's tweakable.


On the top - linear timeline; on the bottom - three curves for controlling different properties

Creating the logic for the reveal using lerps and curves requires the usage of the timeline and curves. It is not very graphics-designer-friendly as it's not handy to tweak these values, and this interface is far from what graphic programs look like.


BP_PuzzleBlock_Toy - the logic for interpolation of curves using the timeline

Control Rig

The second approach, which presents a more animation-oriented workflow, is based on using Control Rig. And so, I need to have a skeletal mesh to use a rig first. I added a single bone that manipulates the whole block. Then I exported it and imported it as a skeletal mesh.


The cube with a single bone prepared to be imported as a skeletal mesh

Then I had to create curve entries inside the skeleton that points to parameters in the material applied to that mesh. This way, I can control material parameters using curves later or just by dragging sliders in the skeleton's window for instant preview.


SKEL_ToyLetterBlock_Skeletal - using animation curves to drive material parameters

The next step was to create a Skeletal Mesh component inside the primary Blueprint of the block actor and set the animation blueprint to one that will use the Control Rig.


BP_PuzzleBlock_Toy_Skeletal - using Skeletal Mesh Component instead of Static Mesh Component

Inside the Event Graph of this Blueprint, I point to the Animation Blueprint and trigger the reveal animation event. I also made the Reveal Letter method callable in the editor by checking a Call in Editor checkbox to click a button and preview that action.


BP_PuzzleBlock_Toy_Skeletal - triggering reveal animation

Inside the Animation Blueprint, I count elapsed time since triggering the reveal action to making a simple timeline.


AB_ToyLetterBlock_Skeletal_ControlRig - a simple timeline inside Animation Blueprint

In the animation blueprint's anim graph the Control Rig receives the RevealProgress parameter to control bone and material inside.


AB_ToyLetterBlock_Skeletal_ControlRig - passing RevealProgress to the Control Rig

And finally, I created the setup of the Control Rig from the cube's skeletal mesh. Still contain ugly curves, but at least there are in one node graph. Looks more compact than in the case of the pure-blueprint solution.


SKM_ToyLetterBlock_Skeletal_CtrlRig - the control rig setup

Skeletal Animation Sequence

The last approach, the most visual one, is slightly similar to the Control Rig approach because it still uses skeletal mesh instead of regular static mesh.

In addition to adding the bone, I had to create a dummy animation that does nothing (here, it lasts 100 frames). It allowed its modification and creation of new custom transformation animation inside the Unreal Engine.


The skeletal mesh with dummy animation

After importing created dummy animation sequence, I opened it and started adding frames to the rotation. I can also added material curves defined in the skeleton and control material parameters from here.


AS_ToyLetterBlock_Skeletal_Reveal - adding material curves to animation sequence

By modifying that dummy animation sequence, I could finally work with a place friendly for animation. In addition, I could use this asset to create an Animation Montage to have more significant control over specific animation sections. I created three sequences from this point - Idle, Reveal and Displayed which I planned to use in the animation's blueprint state machine later.


AS_ToyLetterBlock_Skeletal_Reveal - finally, an animation-friendly interface!

After I prepared new animation assets, I moved to the main blueprint actor, created a Skeletal Mesh Component, and connected the appropriate animation blueprint, similar to the Control Rig approach. Inside the main blueprint actor Event Graph, I created simple triggers that pass requests further down to the animation blueprint.


BP_PuzzleBlock_Toy_Skeletal - events triggering animation sequences

Following down the road, these events are setting the animation state flags and properties:


AB_ToyLetterBlock_Skeletal_Sequence - setting animation state flags

And finally, a state machine lives at the very end of the road, in the heart of Animation Blueprint. Its transitions are driven by flags set


AB_ToyLetterBlock_Skeletal_Sequence - the state machine of the animation blueprint


Regardless I am incredibly far from being an expert in animation inside Unreal Engine, this research gave me an overview of available methods of animating simple rigid objects. While the control rig approach seems overkill, the animation sequence one was enjoyable to work with once the primary sequence was created. I hope to explore more paths and work with more experienced Unreal Engine users to find better workflow.

There is also a plugin on Unreal's marketplace called TweenMaker that seems to simplify the task of animating such objects, and I might give it a try. It seems somebody made a considerable effort to end this trivial task's complexity.

If you liked this post, click >> here << to check out my post about developing a Word Puzzle Board pawn for my Wheel of Fortune game Thanks for reading, and have a great day!