Download

Unable to add actor to level sequence, FGuid linker error

I have simple code which is supposed to add an actor to sequencer. This is in a editor plugin

In header:
static void AddActorToSequencer(ULevelSequence* LevelSequence, AActor* Actor);

In cpp:
void UMyBlueprintFunctionLibrary::AddActorToSequencer(ULevelSequence* LevelSequence, AActor* Actor)
{
UWorld* world = GEditor->GetEditorWorldContext().World();
FGuid ActorGuid = LevelSequence->MovieScene->AddPossessable(Actor->GetActorLabel(), Actor->GetClass());
LevelSequence->BindPossessableObject(ActorGuid, *Actor, world);
}

I get a linker error(LNK2019) while compiling. The issue is with this line –
FGuid ActorGuid = LevelSequence->MovieScene->AddPossessable(Actor->GetActorLabel(), Actor->GetClass());

Editor Modules:
“CoreUObject”,
“Engine”,
“Slate”,
“SlateCore”,
“UnrealEd”,
“Blutility”,
“UMG”,
“UMGEditor”,
“Sequencer”,
“LevelSequence”,
“MovieSceneTracks”

I think you might be missing “MovieScene” module as a dependency in your plugin’s Build.cs.

Thanks. Fixed the issue.