Is there a way to set the location of a level sequence animation in blueprint? I have an animated camera in a sequence but I will need to set the location of where it starts based on other parameters determined at run time. I tried selecting the level sequence actor and “attach to” then moved the object it was attached to, this did indeed change its location, but the objects animated inside the sequence remained unchanged.
Side note: Do overlap events not fire when the overlapping object is in a sequence (IE: my camera)?
Found this answer hub post where an Epic dev said its high-priority, that was quite some time ago though. This would be very useful for dynamic/procedural worlds.
Will probably build a project-specific system to get going for now, but being able to leverage Sequencer would be great.
The workaround at the moment is to attach your actors to some origin placeholder actor and then animate that placeholder actor. In 4.17, you might want to explore the ability to change the transform sections to “relative”. That will make the transform relative to the actor’s original/pre-animated position. Not exactly the same as what you’re looking for, but it might help in some cases.
Hi everyone, to fix this you need to override the default instance data on the Sequence Actor (that you also need to create). The key is to then cast it to UDefaultLevelSequenceInstanceData. See below:
ULevelSequence* IntroSequence = LoadObject(nullptr, TEXT(“/Game/Blueprints/Sequences/IntroSequence”));
if (IntroSequence)
{
// Create a Level Sequence Actor to play the sequence
FMovieSceneSequencePlaybackSettings Settings;
// Optionally, set playback settings
Settings.bAutoPlay = true; // Automatically start playing
ALevelSequenceActor* SequenceActor = nullptr;
// Create the Sequence Player
ULevelSequencePlayer* SequencePlayer = ULevelSequencePlayer::CreateLevelSequencePlayer(
GetWorld(),
IntroSequence,
Settings,
SequenceActor // Pass the pointer by reference
);
if (SequencePlayer && SequenceActor)
{
SequenceActor->bOverrideInstanceData = true;
TObjectPtr<UObject> DefaultInstanceDataObject = SequenceActor->DefaultInstanceData;
UDefaultLevelSequenceInstanceData* InstanceData = Cast<UDefaultLevelSequenceInstanceData>(DefaultInstanceDataObject);
if (InstanceData)
{
InstanceData->TransformOrigin.SetLocation(Location);
InstanceData->TransformOrigin.SetRotation(Rotation);
UE_LOG(LogTemp, Warning, TEXT("IntroPlaySequence called on %s with Location: %s, Rotation: %s"), *GetName(), *Location.ToString(), *Rotation.ToString())
}
// Play the sequence
UE_LOG(LogTemp, Warning, TEXT("MulticastPlayIntroSequence called on %s with Location: %s, Rotation: %s"),
*GetName(), *Location.ToString(), *Rotation.ToString());
SequencePlayer->Play();
}
}