Camera Transitions
Last updated
Last updated
This page explains how the new camera curve transitions work and how you can utilize them to create a more immersive gameplay experience.
A camera curve transition is initiated by calling Start Transition
on the BP_CharacterCurveManager. It requires you to provide a source and target curve. The reason for why Motion does not automatically find the curve used by a component is that a component could be using more than one curve.
The FStructMotionCurveTransitionConfiguration contains all the information the Curve Manager needs.
Both the Identifier
and Target Identifier
describe a FStructMotionCurveIdentifier, containing the component that transitions and the curves used to transition from and to.
The Transition Time
describes the time in seconds Motion should take to transition from the source to the target curve. If you want a sudden, but smooth change in curves, a lower number is recommended.
The Tick Rate
should be left at 1.0.
After a transition has started, a series of events occur:
The Transition is being added to the active transitions array of the curve manager.
The source curve gets the bIsTransitioning
flag.
A new camera curve gets created, using the target curve vector & current rotation, and the source curve's FStructMotionCurveConfiguration, at Tick rate 0.
While the Active Seconds of the transitions have not reached the Transition Time
The source curve's rotation target is set to 0 and is being slowly lerped towards to.
The transitions active seconds are updated.
Transition Events (OnTransitionMinimum, OnTransitionUpdate) are called.
The target curve's tickrate is slowly increased from 0 to 1, depending on the Transition Time
.
When the transition time has been reached:
OnTransitionMaximum
gets called, executing the default behaviour in BP_BaseCharacterCurvedComponent.
It deletes the transition and the source curve.
Removes the old curve's camera offset.
And finally deletes the old curve from the curve manager's array.
It is important that the old curve's rotation information is kept until the transition has finished to ensure that there is no sudden camera twitches.