Ara
Download

Search or run a command

Jump to a section or open an Ara link.

Component · physics

Velocity

Authoritative velocity, synchronized at tick boundaries.

Fields

linear

vec3
World-space linear velocity.
default [0,0,0]m/sreplicated · relevant, rollback

angular

vec3
World-space angular velocity.
default [0,0,0]rad/sreplicated · relevant, rollback

Usage

Every edit is an undoable command: from the CLI as below, or the same JSON from an agent over MCP. See component.add and property.set.

Add it

ara do component.add -p entity=name:Crate -p component=Velocity --why "Add Velocity"

Set a field

ara do property.set -p entity=name:Crate -p path=Velocity.linear -p value=[0,0,0] --why "Tune Velocity"

In a scene document

{
  "Velocity": {
    "linear": [
      0,
      0,
      0
    ]
  }
}

From C#

/// <summary>Apply a two-metre-per-second upward velocity impulse.</summary>
public static void UseVelocity(Entity entity, in Tick tick)
{
    ref var component = ref World.Get<Velocity>(entity);
    component.Linear += new Vector3(0, 2, 0);
}

From C#

Scripts read and write it with Get<Velocity>(); see the Velocity struct.