---
name: "setCenterOfMass"
type: command
status: ok
groups: ["PhysX"]
arma3_since: "1.02"
locality: {"argument": "local", "effect": "global", "server_exec": false}
source: https://community.bistudio.com/wiki/setCenterOfMass
revid: 377797
updated: 2026-01-03T03:53:45Z
---

# setCenterOfMass

*Command · PhysX · Arma 3 v1.02*

Locality: arguments **local** · effect **global**

## Description

Changes the center of mass of an object smoothly during the given time (in seconds). A time of zero (or using the alternative syntax) means an immediate change.

## Syntax

### Syntax 1

```sqf
myObject setCenterOfMass [centerOfMass, time]
```

**Parameters:**

- `myObject`: [Object](../topics/Object.md)
- `centerOfMass`: [PositionRelative](../topics/Position.md#positionrelative) - relative to the model centre
- `time`: [Number](../topics/Number.md) - transition time, 0 for instant center of mass transfer

**Returns:** [Nothing](../topics/Nothing.md)

### Syntax 2

```sqf
myObject setCenterOfMass centerOfMass
```

**Parameters:**

- `myObject`: [Object](../topics/Object.md)
- `centerOfMass`: [PositionRelative](../topics/Position.md#positionrelative) - relative to the model centre

**Returns:** [Nothing](../topics/Nothing.md)

## Examples

### Example 1

```sqf
myObject setCenterOfMass [[0,-1,0], 0.5];
```

### Example 2

```sqf
myObject setCenterOfMass [0,-1,0];
```

## See also

[getCenterOfMass](../commands/getCenterOfMass.md) · [setMass](../commands/setMass.md) · [getMass](../commands/getMass.md)

<sub>Source: [BI Community Wiki — setCenterOfMass](https://community.bistudio.com/wiki/setCenterOfMass) (revision 377797).</sub>
