The Organic Movement Component has built-in support for predicting and replicating montages (with or without root motion). The setup is very simple, and there’s usually no need to manually call any RPCs. Read on for more details.

Playing Montages

The GMC provides a custom node for playing montages called GMC Play Montage.

You can use this node in your movement logic to play a montage according to the passed arguments. Treat this node like any other predicted code, all rules laid out in the Networking Introduction chapter still apply. Even if you play server-side montages outside of the prediction tick, the client will automatically be corrected as montages are fully supported for replay. You can adjust the settings for montage replication in the Movement|Advanced|MontageReplication category of the movement component.

Normally you can’t use latent nodes for predicted logic, the GMC Play Montage node is an exception, as it was specifically designed to be used in this context. The latent events coming from the node are marked as either Networked or Cosmetic. Networked events are called from the prediction tick and thus can be used for movement and gameplay logic. The Cosmetic events are called from the animation system, so they should only be used for visual effects that have no bearing on gameplay. For example, the following demonstration shows how you could play a predicted montage from the MovementUpdate event and make the pawn jump in the air when the animation starts to blend out. With the default settings, the montage will also be simulated automatically for any other connected players, no further setup is required on your part.

The GMC Play Montage node can ignore superfluous calls, which makes it easier to use in a tick function. If Interrupt Other is true, only play requests that pass the same montage will be ignored if that montage is already active. If Interrupt Other is false, all additional play requests (regardless of which montage is passed) will be ignored until the currently active montage has finished. Cancel on Blend In and Cancel on Blend Out always apply to any montage, regardless of the setting of Interrupt Other.

The GMC Play Montage node is a callback proxy for use in the Blueprint; the underlying function is called PlayMontage_Blocking, which you have to use in C++. You may already know that you have to bind to the corresponding delegates to use the montage events in C++. The functions for setting the delegates are called SetMontage<Event>Delegate, but you also have the option to simply override the OnMontage<Event> virtual functions instead of utilizing delegates (where <Event> is the type of montage event you are interested in, e.g. BlendOut).

Other Montage Operations

There are several more functions available which are part of the UGMC_MovementUtilityCmp class and can be used for montage related operations. Some of them are displayed in the following picture. They are essentially just wrappers around default UE functionality and are fairly self-explanatory (remember that you can hover over nodes and pins to see a description).

When using the Organic Movement Component, you can usually just pass the inherited Skeletal Mesh and Montage Tracker variables into the appropriate function pins to use these nodes (do not create a new variable of type FGMC_MontageTracker yourself to pass into the function). The When Extrapolating parameter is only relevant for simulated pawns executing the movement logic, and the default value is appropriate for most standard use cases.

Adding Montage Meta Data

The behaviour of individual montages can be adjusted by adding montage meta data to the asset. For example, you could configure a montage to ignore root motion while blending in or out. To do this, create a Blueprint of type UGMC_MontageMetaData and adjust the settings inside the Blueprint as desired. You can hover over the individual options to read their descriptions. Afterwards, add the Blueprint as meta data to any montage that should use the these settings. This can be done in the Asset Details window of the montage under the Meta Data category (simply add the Blueprint to the meta data array).