Unreal Engine 4 Animation Slot

simplycodes
2 min readJan 18, 2021

Register here

  1. Unreal Engine 4 Animation Slot Games
  2. Unreal Engine 4 Animation Slot
Animation

This might be a little late but for posterity’s sake I figured I would answer this question.

Unreal Engine 4 and Daz Studio are outstanding, freely available animation programs that allow you to create stunning character animations like a professional. This course uses high-quality Daz 3D characters to teach you how to export any morph target of your choice from Daz Studio and use it in Unreal Engine 4. Open the main player animation blueprint and in the AnimGraph right click and bring up the ‘DefaultSlot’. Click on the default slot node. Down in the settings panel click on the search icon next to the slot name so to open the Anim Slot Manager. In here click on Add Slot and create a new slot called ‘Body’. What I did is create 1 animation for each, but have both hands performing the exact same motions. I then use Layered blend per bone node to blend an Animation Blend for the characters leg Movement and 2 Animation Blends I used for my arms (one for left, one for right, both starting at a joint near my characters clavicles.).

PlaySlotAnimation() and PlaySlotAnimationAsDynamicMontage() are a bit strange because the Asset parameter is of the UAnimSequenceBase class, but the function name suggests that you pass it an animation montage (UAnimMontage) and it plays a slot in that montage. When in reality what actually happens is that the function is expecting an animation sequence to use to create an animation montage, and the slot name you pass it is the slot name in the new dynamically generated montage. In fact the first check in the code is to see that it is NOT an animation montage:

So if you pass in an animation montage, the asset will always be marked as NOT valid and the function will exit.

In other words, you can’t use PlaySlotAnimation() or PlaySlotAnimationAsDynamicMontage() to play a slot in an animation montage that already exists. You’ll just have to create multiple animation montages and use MontagePlay() to play them.

Unreal Engine 4 Animation Slot Games

This is a bit of a strange design decision, if someone from Epic could clarify as to why there is not a function to play an animation from an existing montage that would be awesome; maybe I just missed it? The function naming is poor though IMO, something like PlayDynamicMontage() may have been better. I would be interested to hear someone else’s thoughts though.

Unreal Engine 4 Animation Slot

(Referencing code at ea7b5e4da1ca360c4800fc11f1125c3c38f68f12, which is on the 4.19 branch)

Register here

--

--