Skip to content

Variable: PhysicsManipulation

const PhysicsManipulation: Component<{ angularVelocity: { default: [number, number, number]; type: Vec3; }; force: { default: [number, number, number]; type: Vec3; }; linearVelocity: { default: [number, number, number]; type: Vec3; }; }>

Defined in: packages/core/src/physics/physicsManipulation.ts:40

Component for applying one‑time physics manipulations to an entity.

Remarks

  • This component is automatically removed after the manipulations are applied.
  • Force is applied as an impulse at the entity's center of mass.
  • Setting linear or angular velocity overrides the current velocity.
  • All manipulations are applied in a single frame, then the component is removed.
  • Requires the entity to have PhysicsBody.

Examples

ts
entity.addComponent(PhysicsManipulation, {
  force: [0, 10, 0]
})
ts
entity.addComponent(PhysicsManipulation, {
  linearVelocity: [5, 0, 0],
  angularVelocity: [0, 2, 0]
})

See