Unresolved external symbol FRootMotionMovementParams::RootMotionScale

Hello,

I have problems updating my plugin to the latest unreal version. Since UAnimMontages are no longer included by default ( UAnimMontage is undefined after update - Programming & Scripting - Unreal Engine Forums ) I added an "#include “Animation/AnimMontage.h” to the relevant .cpps that are using it. Now however the linker throws up this when I try to compile:

error LNK2001: unresolved external symbol "private: static struct FVector FRootMotionMovementParams::RootMotionScale" (?RootMotionScale@FRootMotionMovementParams@@0UFVector@@A)

I tried reproducing the error by creating a new project and adding a anim montage reference there but it compiles just fine. I also checked that the dependencies are the same ( “Core”, “CoreUObject”, “Engine”, “InputCore” ) but to no avail.

Then I looked up where the value in question was defined and it is in Engine/Source/Runtime/Engine/Private/AnimationAsset.cpp. Does that mean plugins do not have access to it?

Any pointers on how to fix this?

Kind Regards

Ok I have re-created the initial setup using the New Plugin function of the editor and everything works find with it, I will now investigate why it doesn’t work in my plugin.

Alright I at least found the cause of the error: RootMotionParams.Accumulate in my custom movement component.

The question now is what do I have to do to make it work again?

A very dirty temporary fix is redefining it in my .cpp with “FVector FRootMotionMovementParams::RootMotionScale(1.0f, 1.0f, 1.0f);” but that only works until I want to make a build because then it complains about double definitions (obviously).

As far as I can tell it is only ever used to reset the root motion scale and is otherwise not used at all. So why is it hidden then?

I also cannot create custom RootMotion sources, because that results in the same error.

Kind Regards

I have exact the same error.

“private: static struct FVector FRootMotionMovementParams::RootMotionScale”

i changed AnimationAssets.h file.now i can compile or build game without error.

void Set(const FTransform& InTransform)
{
	bHasRootMotion = true;
	GetRootMotionTransformInternal() = InTransform;
	GetRootMotionTransformInternal().SetScale3D(FVector(1.0f, 1.0f, 1.0f));
	BlendWeight = 1.f;
}

This is good to know and hopefully Epic fixes that soon, however it doesn’t help me right now as I have to make it work with the Pre-Build version from the launcher.

yes it works

You can easily fix this problem by adding ENGINE_API to FRootMotionMovementParams::RootMotion so that it can be linked properly into your game.

static ENGINE_API FVector RootMotionScale;

Seems like the guys at Epic forgot to add that macro. Or maybe they are planning a different solution, but for now this will allow your project to compile.

Franco