> For the complete documentation index, see [llms.txt](https://docs.overdare.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.overdare.com/development/api-reference/classes/vectorforce.md).

# VectorForce

VectorForce : `Constraint`

## Overview

A physics constraint instance used to apply continuous force and acceleration to an Object.

As this constraint causes acceleration to accumulate continuously, Objects can move extremely fast without opposing forces. Therefore, LinearVelocity constraint is preferred for maintaining constant velocity.

The reference for applying force depends on whether the RelativeTo property is set to World or Attachment

## Properties

### ApplyAtCenterOfMass

`boolean`

Sets where the force is applied.

When disabled, the force is applied to the Object's center (center of mass). When enabled, the force is applied at Attachment0's position, which may cause rotation if not at the center.

#### Code Samples

### Force

`Vector3`

Sets the magnitude and direction of the force.

#### Code Samples

```lua
local Part = script.Parent
local Attachment = Part.Attachment

local VectorForce = Instance.new("VectorForce")
VectorForce.Attachment0 = Attachment
VectorForce.RelativeTo = Enum.ActuatorRelativeTo.World
VectorForce.Force = Vector3.new(500000, 0, 0)
VectorForce.Parent = Part
```

### RelativeTo

`Enum.ActuatorRelativeTo`

Sets the reference coordinate system for applying force.

#### Code Samples

```lua
local VectorForce = script.Parent

VectorForce.RelativeTo = Enum.ActuatorRelativeTo.World
```

## Methods

## Events

## See also

{% content-ref url="/pages/92QXleNfbim97B0uhIQs" %}
[Physics](/manual/studio-manual/object/physics.md)
{% endcontent-ref %}
