Skip to content
CISV2.0GET IT ON FAB

SYSTEMSMOVE HANDLERS

Move handlers

A move handler brings the character into place for a use. It walks the character to a point, turns it towards a point, or does both, before or while the side’s Action runs. It is a class derived from UCISInteractionObjectMoveHandler, and each side of an interaction object can name one in Interaction Object Side Move Handler. A side without a move handler runs its Action where the character stands. The sides belong to the interaction object component.

  • It moves the character for the use. Your code moves it, for example with root motion or with a latent node, and the handler reports when the movement is done.
  • It has four Blueprint events that the plugin calls at the phases of the movement: StartMovement, HandlerTick, MovementAborted and MovementFinished.
  • It ends the movement with FinishMovement. Until then, an Action that waits for the movement does not start.
  • It runs on the machines that its Net Execution Policy names, which is every machine by default.

Start. The use starts the movement of the side’s handler at its Moving phase, and calls StartMovement on each machine that runs the handler. The player’s machine leads the step by default, and the other machines run their own copies when its phase arrives. A handler with Net Execution Policy set to something else runs only where that policy says. The handler’s copy is made for each use when its Instancing Policy is InstancedPerExecution, which is the default of a Blueprint class. See Actions for the same rules.

Ticks. HandlerTick runs once a frame while the movement runs and the use is still going. It stops when the movement finishes, unless Continue Tick After Finish Movement is on, which is off by default. The handler does not tick as a class default or an archetype.

Finish. FinishMovement ends the movement and calls MovementFinished once. A call while no movement runs does nothing, and the plugin logs it at the Verbose level of CISLog. This is the case for a movement that never started, or one that the plugin already ended. Once the movement has finished, the Action of the side starts, unless Action Execution Type is StartParallelWithMoveHandler, in which case the Action started with the movement. Is Movement Finished tells whether the call has been made.

Abort. When the use is interrupted before the movement finishes, the plugin calls MovementAborted, so the handler can stop what it does to the character. A handler that is shared between uses is also told after its movement has finished.

Action Execution Type. Each side has this setting. StartAfterFinishMoveHandler, the default, starts the Action when the movement finishes. StartParallelWithMoveHandler starts the Action at once, with the movement. The use then ends when the Action finishes, and the movement is finished by the plugin if it still runs.

The demo move handlers. The demo ships two move handlers, and both derive from BP_BaseMoveHandler:

  • BP_MoveToComponentMoveHandler walks the character to Move To This Component and turns it to Looking Point. It has no variables of its own.
  • BP_MoveToDistanceMoveHandler walks the character to a point that is Move Distance away from Move To This Component, on the character’s side, and turns it to Looking Point. Move Distance is 75 in the Blueprint. The handler on the demo pick-up item sets 60.

Both move only BP_CISCharacter. When the character is another class, the handler finishes at once, so the Action runs without the walk. The handlers move the character with RootMotionMoveTo. The camera and the rotation are changed only on the machine of a locally controlled character.

The base class holds the variables that the two handlers share: Move To This Component, Looking Point, Look Point Focus Time, Need Return Camera Rotation, Return Camera Speed, Start Return Camera Time, Camera Rotation Speed, Character Rotation Speed and Time After Finish Movement.

The steps are in the guides, so this page gives only the outline. Follow these guides in order:

  1. Add the approach point and the look point to the object as components, and name them in the side, as Two-sided door does in its steps 1 and 3.
  2. Set the move handler of the side, with its two references, and fill the Actions of the side, as Two-sided door does in its step 3.
  3. Add the second side with its own move handler, as Two-sided door does in its step 4.

To write a move handler of your own:

  1. Make a Blueprint from UCISInteractionObjectMoveHandler.
  2. Override Start Movement, and move the character. Read the character from the event’s Interaction Character pin.
  3. Call Finish Movement when the character reaches its point. Until that call, an Action that waits for the movement does not start.
  4. Override Movement Aborted if the handler must undo something when the use is interrupted.
  5. Set the Blueprint in Interaction Object Side Move Handler of a side.

Override Handler Tick only when the movement needs a per-frame update, and then call Finish Movement from it when the movement is done. Turn on Continue Tick After Finish Movement only if the handler must keep ticking after the call.

Settings
Continue Tick After Finish Movement
Execution
Instancing PolicyDefault
Net Execution PolicyAll Machines
Replication
With Replication
The settings of a move handler class: its movement settings, its execution settings and its replication setting.
SettingWhat it doesDefault
Continue Tick After Finish MovementWhether Handler Tick keeps running after Finish Movement.Off
Net Execution PolicyThe machines the handler runs on: All Machines, Local Predicted, Server Only or Local Only.All Machines
Instancing PolicyWhether one handler object serves every use (Shared Per Object) or a copy is made for each use (Instanced Per Execution). Default picks by the class.Default
With ReplicationWhether the handler’s own RPCs and replicated variables work over the network. Off: they run on the local machine only.On
Action Execution Type (set on each side)When the side’s Action starts: after the movement finishes, or with it.Start After Finish Move Handler
  • Walk to the front of BP_MyDoor, the door of Two-sided door, and press E. The character walks to the front position, and then the door opens.
  • With your own handler, the character must reach its point before the Action starts. If the Action starts while the character is still walking, the side’s Action Execution Type is StartParallelWithMoveHandler.
  • The character is not walked to the point. The handler moves only BP_CISCharacter in the demo. Another character gets no walk, and its Action still runs. In your own game, check that the handler moves that character.
  • The Action never starts. The movement never finishes, because nothing calls Finish Movement. With the default Action Execution Type the Action waits for the movement. Check the handler’s graph for the call.
  • A call of Finish Movement has no effect. The movement is not running: it never started, or the plugin already ended it. The plugin writes a Verbose line to CISLog, which shows only at log CISLog Verbose.
  • Handler Tick stops after Finish Movement. This is the default. Turn on Continue Tick After Finish Movement only if the tick must go on.
  • The character walks to the wrong point or to none. The side’s Move To This Component or Looking Point names a component the object does not have. The Output Log then shows Component '<name>' (<class>) not found on <actor> (class <class>). Select the component again in the settings.
  • The Action runs at the same time as the walk. The side’s Action Execution Type is StartParallelWithMoveHandler. Set StartAfterFinishMoveHandler to start the Action after the walk.
  • The movement goes on after the use is interrupted. The plugin calls Movement Aborted when the use ends before the movement finishes. Nothing stops the movement by itself: override Movement Aborted and stop it there.