UAnimInstance::Montage_PlayWithBlendSettings
#include "Animation/AnimInstance.h"
Access: public
Specifiers: UFUNCTIONBlueprintCallable
Description
Plays a UAnimMontage with fully customized blend-in settings via FMontageBlendSettings, which supports BlendProfiles for per-bone weighting in addition to the curve and timing options of FAlphaBlendArgs.
Caveats & Gotchas
- • FMontageBlendSettings only controls blend-in — blend-out is still governed by the montage asset or an explicit Montage_StopWithBlendSettings call.
- • Supplying a BlendProfile that references bones absent from the skeleton silently falls back to an unweighted blend for the missing bones rather than erroring.
Signature
ENGINE_API float Montage_PlayWithBlendSettings(UAnimMontage* MontageToPlay, const FMontageBlendSettings& BlendInSettings, float InPlayRate = 1.f, EMontagePlayReturnType ReturnValueType = EMontagePlayReturnType::MontageLength, float InTimeToStartMontageAt=0.f, bool bStopAllMontages = true); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| MontageToPlay | UAnimMontage* | The montage asset to play. | — |
| BlendInSettings | const FMontageBlendSettings& | Full montage blend settings for the blend-in phase, including optional BlendProfile. | — |
| InPlayRate | float | Playback speed multiplier. | 1.f |
| ReturnValueType | EMontagePlayReturnType | Controls whether the return value represents the montage length or the play rate. | EMontagePlayReturnType::MontageLength |
| InTimeToStartMontageAt | float | Position in the montage at which to start, in seconds. | 0.f |
| bStopAllMontages | bool | If true, all other active montages are stopped before this one begins. | true |
Return Type
float Example
Play a death montage with per-bone blend-in profile C++
FMontageBlendSettings BlendInSettings;
BlendInSettings.Blend.BlendTime = 0.25f;
BlendInSettings.Blend.BlendOption = EAlphaBlendOption::HermiteCubic;
BlendInSettings.BlendProfile = DeathBlendProfile; // UBlendProfile*
AnimInstance->Montage_PlayWithBlendSettings(DeathMontage, BlendInSettings); Tags
Version History
Introduced in: 5.3
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?