Linker error using UWidgetAnimation::BindToAnimationFinished

Fraps2020
Tue, 09 Mar 2021 15:02:28 +0000
UI

Hi,

I’m really bugged by a LNK2019 happening trying to use UWidgetAnimation::BindToAnimationFinished.

I do have the UMG modules specified in my Build.cs:

public class Theseus : ModuleRules
{
	public Theseus(ReadOnlyTargetRules Target) : base(Target)
	{
		PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;

		PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "HeadMountedDisplay" });
		PublicDependencyModuleNames.AddRange(new string[] { "UMG", "Slate", "SlateCore" });
		PrivateDependencyModuleNames.AddRange(new string[] { "GameplayTasks", "AIModule", "NavigationSystem" });
		PrivateDependencyModuleNames.AddRange(new string[] { "Niagara" });
	}
}

I do have the right includes in my widget class (derived from UUserWidget):

#include "Animation/WidgetAnimation.h"
#include "Blueprint/UserWidget.h"

And this is how I’m trying to bind a UFUNCTION with BindToAnimationFinished:

FWidgetAnimationDynamicEvent MyAnimationEvent;
MyAnimationEvent.BindDynamic(this, &UWidgetInventory::BindingTest);
GetAnimationByName(TEXT("FadeOutMessages"))->BindToAnimationFinished(this, MyAnimationEvent);

However, no matter how I clean my build and rebuild, this is what I get:

error LNK2019: unresolved external symbol "public: void __cdecl UWidgetAnimation::BindToAnimationFinished(class UUserWidget *,class FWidgetAnimationDynamicEvent)" (?BindToAnimationFinished@UWidgetAnimation@@QEAAXPEAVUUserWidget@@VFWidgetAnimationDynamicEvent@@@Z) referenced in function "protected: virtual void __cdecl UWidgetInventory::NativeConstruct(void)" (?NativeConstruct@UWidgetInventory@@MEAAXXZ)

I’ve also tried to use a plain pointer to a specified UWidgetAnimation (ie. not a pointer returned by my function GetAnimationByName) to no avail.

I beg your help, this is driving me crazy!

Thank you,

f

5 posts - 3 participants