1 min read

[22/50] Parallel operations in animation blueprints in Unreal

Stable Diffusion result for: "An artwork depiction animations."
Stable Diffusion result for: "An artwork depiction animations."

Moving animation calculations off the main game thread can release precious CPU cycles to allocate to other tasks. Unreal Engine 5 now has support for multi-threaded animations. This feature is gated behind a project setting. We first encountered this functionality and its usage in the Lyra Project that Epic makes available for free on their marketplace.

To enable this feature ensure that Allow Multi Threaded Animation Update is checked in the Project Settings > Animation Blueprints section. And finally, in the Class Settings of the animation blueprint itself, we need to enable Use Multi Threaded Animation Update checkbox.

With this change all data modification and access done via the animation blueprints needs to be thread-safe. To this end, accessing data directly within the blueprints is not advised and, instead, all data operations must be routed through the FAnimInstanceProxy - which per the official documentation:

Proxy object passed around during animation tree update in lieu of a UAnimInstance.

To futher ensure optimal performance with this change, it is advised not to access UAnimInstance from others classes rather have the UAnimInstance pull the data from other classes where needed.

The official documentation for Animation Optimization in Unreal can be found here.