Is it possible to change the Skeletal Mesh Component to PlayMontageAndWait as in PlayMontage?
I have 3 Skeletal Mesh Component in my character and the player can decide in the game which one to use. With PlayMontage the change works well. But with PlayMontageAnWait the first mesh is always the target.
In case anyone is looking, there is no blueprint solution. But you can override InitAbilityActorInfo in UAbilitySystemComponent. In this just call the Super method and then replace the reference AbilityActorInfo->SkeletalMeshComponent.
Example Header:
#pragma once
#include "CoreMinimal.h"
#include "AbilitySystemComponent.h"
#include "GothGirlAbilitySystemComponent.generated.h"
UCLASS(ClassGroup="GothGirl", meta=(BlueprintSpawnableComponent))
class GOTHGIRL_API UGothGirlAbilitySystemComponent : public UAbilitySystemComponent
{
GENERATED_BODY()
protected:
virtual void InitAbilityActorInfo(AActor* InOwnerActor, AActor* InAvatarActor) override;
};
Warning there is a UAbilitySystemComponent::RefreshAbilityActorInfo() which is not overridable and can be called by blueprints. This will reset AbilityActorInfo->SkeletalMeshComponent. Just don’t use it.