Skip to content

Logic Move Linear

Henry de Jongh edited this page Mar 17, 2023 · 4 revisions
Description Icon
A reactive logic component that moves between two points.

Parameters

Name Description
Start Opened Whether the linear motion is already fully open upon scene start.
Target 1 The target point that the movement begins at.
Target 2 The target point that the movement ends at.
Time The time in seconds the full linear motion takes.
Curve The animation curve adjusts the linear motion.

Inputs

Name Description Parameter
Open Move towards the end of the linear motion with positive speed. None
Close Move towards the beginning of the linear motion with negative speed. None
Reverse Reverses the linear motion so that it travels in the other direction. None
SetTime Sets the linear motion time to the float parameter. seconds (float) The time in seconds a full linear motion takes.

Outputs

Name Description Parameter
Arrived Invoked when the linear movement arrives at a destination. None
ArrivedAtTarget1 Invoked when the linear movement arrives at target 1. None
ArrivedAtTarget2 Invoked when the linear movement arrives at target 2. None
Departed Invoked when the linear movement departs from a destination. None
DepartedFromTarget1 Invoked when the linear movement departed from target 1. None
DepartedFromTarget2 Invoked when the linear movement departed from target 2. None

Remarks

On Awake this component checks for a Rigidbody on the same game object. If found then FixedUpdate will be used with Rigidbody.MovePosition() for better physics engine interaction.

If you want to combine several of these components so that they all move relative to each other with rigid bodies, make sure that you only parent the target points and not the object itself, otherwise the interpolation will break and the rigid body will not move (or stutter and jump).

For a more powerful system have a look at Logic Animator.

Clone this wiki locally