##### Views

- Page
- Discussion
- View source
- History

# Body:setMass

Available since LÖVE 0.8.0
This variant is not supported in earlier versions.

Sets a new body mass.

| There is a bug in 0.8.0 where a high mass will be too large for the rotational inertia and throw an uncaught exception resulting in the termination of LÖVE. It's recommended to use Body:setMassData instead. |

## Function

### Synopsis

body:setMass( mass )

### Arguments

`number mass`
  The mass, in kilograms.

### Returns

Nothing.

Removed in LÖVE 0.8.0
This variant is not supported in that and later versions.

Sets the mass properties directly.

If you're not sure what all this stuff means, you can use body:setMassFromShapes after adding shapes instead.

The first two parameters will be the local coordinates of the Body's center of mass.

The third parameter is the mass, in kilograms.

The last parameter is the rotational inertia.

## Function

### Synopsis

body:setMass( x, y, m, i )

### Arguments

`number x`
  The x-component of the center of mass in local coordinates.
`number y`
  The y-component of the center of mass in local coordinates.
`number m`
  The mass, in kilograms.
`number i`
  The rotational inertia, in kilograms per squared meter.

### Returns

Nothing.

## See Also

- Body

## Other Languages

Dansk – Deutsch – English – Español – Français – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Polski – Português – Română – Slovenský – Suomi – Svenska – Türkçe – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – ไทย – 日本語 – 正體中文 – 简体中文 – Tiếng Việt – 한국어
More info

Retrieved from "https://www.love2d.org/wiki/Body:setMass"
Categories: Templates | Functions

##### Personal tools

- Log in

##### Search

##### Toolbox

- What links here
- Related changes
- Special pages
- Printable version
- Permanent link
- Browse properties