2 min read

Source: Roblox Creator Hub · CC BY 4.0 · View source · Code samples: MIT Imported 2026-10-03. Formatting adapted for this site.

VectorForce

Note

For an overview on creating, visualizing, and simulating mover constraints, including VectorForce, see mover constraints. Also see Roblox units to understand how Roblox units compare to metric units.

The VectorForce constraint applies constant linear force on an assembly. The direction and strength of the force is determined by a Vector3 and can be relative to an attachment on the part, another attachment, or the world coordinate system.

Note

Because the VectorForce constraint applies constant force and acceleration, very high speeds may result if no other forces are involved. If you want to maintain a more steady velocity over time, use a LinearVelocity constraint. Alternatively, if you only need initial velocity, set the AssemblyLinearVelocity property directly on the assembly.

Force location

By default, force is applied to the assembly at the location of Attachment0. Thus, if its center of mass is not aligned with the direction/point of force, torque will be applied as well. If desired, force can be focused at the center of mass by toggling on ApplyAtCenterOfMass.

<video controls src="https://prod.docsiteassets.roblox.com/assets/physics/constraints/VectorForce-ApplyAtCenterOfMass-False.mp4" alt="Video showing ApplyAtCenterOfMass set to false"></video>

ApplyAtCenterOfMass = false

<video controls src="https://prod.docsiteassets.roblox.com/assets/physics/constraints/VectorForce-ApplyAtCenterOfMass-True.mp4" alt="Video showing ApplyAtCenterOfMass set to true"></video>

ApplyAtCenterOfMass = true

Relativity

By default, force is applied relative to Attachment0. If the parent assembly rotates, the force will change direction to match the adjusted orientation of the attachment; visualize this behavior in how the thruster of a rocket pushes it forward, regardless of the rocket's rotation.

If RelativeTo is set to World, force will be applied in world coordinates, independent of the parent or attachment orientations; visualize this behavior as a directional force like the wind blowing against an object.

If RelativeTo is set to Attachment1, force will be applied relative to Attachment1 and, if the attachment rotates, the force will change to match its orientation.

<video controls src="https://prod.docsiteassets.roblox.com/assets/physics/constraints/VectorForce-RelativeTo-Attachment0.mp4" alt="Video showing RelativeTo set to Attachment0"></video>

RelativeTo = Attachment0

<video controls src="https://prod.docsiteassets.roblox.com/assets/physics/constraints/VectorForce-RelativeTo-World.mp4" alt="Video showing RelativeTo set to World"></video>

RelativeTo = World