Animating Rigid Objects
Introduction
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.
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
:
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:
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.
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.
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.
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.
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.
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.
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.
Inside the Animation Blueprint, I count elapsed time since triggering the reveal action to making a simple timeline.
In the animation blueprint's anim graph the Control Rig receives the RevealProgress
parameter to control bone and material inside.
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.
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.
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.
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.
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.
Following down the road, these events are setting the animation state flags and properties:
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
Conclusion
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!