UAnimInstance::Montage_PlayWithBlendIn
#include "Animation/AnimInstance.h"
Access: public
Specifiers: UFUNCTIONBlueprintCallable
Description
Plays a UAnimMontage asset with a custom blend-in specified by FAlphaBlendArgs, overriding the blend-in time baked into the montage asset.
Caveats & Gotchas
- • Only the blend-in is overridden — blend-out still uses the value stored in the montage asset itself. Use Montage_PlayWithBlendSettings to override both.
- • Setting bStopAllMontages to false allows layered montages to coexist, but requires that their slot nodes do not overlap or the weights will stack beyond 1.0.
Signature
ENGINE_API float Montage_PlayWithBlendIn(UAnimMontage* MontageToPlay, const FAlphaBlendArgs& BlendIn, 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. | — |
| BlendIn | const FAlphaBlendArgs& | Alpha blend arguments overriding the montage asset's default blend-in. | — |
| 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 (in seconds) at which to start. | 0.f |
| bStopAllMontages | bool | If true, all other active montages are stopped before this one begins. | true |
Return Type
float Example
Play an attack montage with a snappy custom blend-in C++
FAlphaBlendArgs QuickBlendIn(0.05f);
QuickBlendIn.BlendOption = EAlphaBlendOption::Linear;
AnimInstance->Montage_PlayWithBlendIn(AttackMontage, QuickBlendIn, 1.2f); Tags
Version History
Introduced in: 5.1
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?