Skip to main content

MoveTowardsModifier

A class in Root.Township, the global namespace.

Float modifier that moves its output toward the input value at a fixed speed, in fixed update.

Constructors​

MemberWhat it is
MoveTowardsModifier()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

4 private and internal fields
MemberWhat it is
private float currentValueCurrent output value.
private float speedUnits per second the value moves.
private float targetValue being moved toward.
private IUnityUpdateMethod updateFixed update handle while moving.

Methods​

MemberWhat it is
override void Input(float value)Sets a new target and starts moving if it changed.
2 private and internal methods
MemberWhat it is
private void Awake()Starts the target at the current value.
private void MoveTowards()Steps the value toward the target, outputs it, and stops once it arrives.