codeAPI Reference

s&box FuncMover: Moving and rotating objects

calendar_today May 12, 2026 schedule ~2 min read person PatrickJr verified 50

FuncMover Component API Reference

FuncMover is a Component that moves and rotates a GameObject with configurable linear and rotational movement patterns.

Type Signature

CSHARP
[Category("Gameplay"), Icon("open_with"), EditorHandle(Icon = "🚚"), Tint(EditorTint.Green)]
public sealed class FuncMover : Component
{
    [Property] bool StartOn { get; set; } = true;

    // Linear Move
    [Property, FeatureEnabled("LinearMove", Icon = "🚀")]
    public bool LinearMove { get; set; } = true;

    [Property, Feature("LinearMove")]
    public Vector3 LinearDistance { get; set; } = Vector3.Up;

    [Property, Feature("LinearMove"), Sync(SyncFlags.FromHost)]
    public float LinearSpeed { get; set; } = 10.0f;

    [Property, Feature("LinearMove")]
    public bool LinearLoop { get; set; } = true;

    [Property, Feature("LinearMove"), ShowIf(nameof(LinearLoop), true)]
    public float LinearPauseDuration { get; set; } = 0.0f;

    // Rotate Move
    [Property, FeatureEnabled("RotateMove", Icon = "🔄")]
    public bool RotateMove { get; set; } = false;

    [Property, Feature("RotateMove")]
    public Angles RotationDirection { get; set; } = Angles.Zero;

    [Property, Feature("RotateMove"), Sync(SyncFlags.FromHost)]
    public float RotationSpeed { get; set; } = 10.0f;

    [Property, ReadOnly, Sync(SyncFlags.FromHost), Group("Debug")]
    bool IsOn { get; set; }

    public void Toggle();
    [Rpc.Host] public void TurnOn();
    [Rpc.Host] public void TurnOff();
    [Rpc.Host] public void SetLinearSpeed(float speed);
    [Rpc.Host] public void SetRotationSpeed(float speed);
}

Properties

Linear Movement

Rotational Movement

Control

Methods

Toggle()

Toggles the mover on/off via RPC.

TurnOn() / TurnOff()

Turns the mover on or off via RPC.

SetLinearSpeed(float speed) / SetRotationSpeed(float speed)

Sets the movement or rotation speed via RPC.

Usage

CSHARP
// Create a moving platform
var mover = go.AddComponent<FuncMover>();
mover.LinearMove = true;
mover.LinearDistance = Vector3.Up * 100;
mover.LinearSpeed = 50.0f;
mover.LinearLoop = true;
mover.LinearPauseDuration = 2.0f;

Notes

  • Runs in OnFixedUpdate for consistent physics timing
  • LinearLoop with pause duration creates a back-and-forth movement with pauses
  • Rotation is continuous when enabled
  • All speed properties are synced from host
  • DrawGizmos shows movement path in editor
Was this helpful?