# 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="../../../manual/studio-manual/object/physics" %}
[physics](https://docs.overdare.com/manual/studio-manual/object/physics)
{% endcontent-ref %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.overdare.com/development/api-reference/classes/vectorforce.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
