MassEntityTrait Fragment changing not working

Hello everyone! I am working on a large project that uses Mass. Mostly I relied on Mass community sample. And everything worked well, until I tried to edit a fragment from the trait.

When I change function for the trait from “BuildContext.AddFragment” to “BuildContext.AddFragment_GetRef” I get LNK2019 Error. These functions are from the same file/module, so all standard includes and .Build.cs includes are definitely in place.

The error:

MassAITremperTrait.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl FInstancedStruct::FInstancedStruct(class UScriptStruct const *)" (__imp_??0FInstancedStruct@@QEAA@PEBVUScriptStruct@@@Z) referenced in function "protected: virtual void __cdecl UMassAITremperTrait::BuildTemplate(struct FMassEntityTemplateBuildContext &,class UWorld const &)const " (?BuildTemplate@UMassAITremperTrait@@MEBAXAEAUFMassEntityTemplateBuildContext@@AEBVUWorld@@@Z).

Trait .cpp file:

void UMassAITremperTrait::BuildTemplate(FMassEntityTemplateBuildContext& BuildContext, const UWorld& World) const

	BuildContext.AddFragment_GetRef<FCrowdTemperFragment>().Agression = 23.0f;


Where is my error, or is there any other way to change the fragment from Trait’s Build template?

Found solution myself, I needed to add module “StructUtils”

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.