Hi everyone,
I’ve encountered an issue in Unreal 5.5 with the SetAnimationCurrentTime
method for UMG animations. It seems this method no longer works as expected, preventing us from skipping to a specific frame in widget animations.
The problem appears to be related to the new UnwarpedPosition
variable introduced in the UUMGSequencePlayer
class. I’m not entirely sure of its purpose, but it seems to override the time set by SetCurrentTime
during the tick.
What’s happening:
In UUMGSequencePlayer::SetCurrentTime
, the TimeCursorPosition
is correctly updated. However, in the next tick, it gets overridden by UnwarpedPosition
:
UnwarpedPosition += DeltaFrameTime;
FFrameTime LastTimePosition = TimeCursorPosition;
const FMovieSceneSequenceHierarchy* Hierarchy = RootTemplateInstance.GetHierarchy();
FMovieSceneSequenceTransform RootTransform;
if (Hierarchy && Hierarchy->GetRootTransform().FindFirstWarpDomain() == UE::MovieScene::ETimeWarpChannelDomain::PlayRate)
{
RootTransform = Hierarchy->GetRootTransform();
}
TimeCursorPosition = RootTransform.TransformTime(UnwarpedPosition);
My Quick Fix:
I resolved the issue by updating UnwarpedPosition
directly in the SetCurrentTime
method.
void SetCurrentTime(float InTime)
{
TimeCursorPosition = UnwarpedPosition = AnimationResolution.AsFrameTime(InTime);
}
This fix solves my problem, but I’m curious if there are any side effects or a better approach.