---
title: density
framework: spritekit
role: symbol
role_heading: Instance Property
path: spritekit/skphysicsbody/density
---

# density

The density of the object, in kilograms per square meter.

## Declaration

```swift
var density: CGFloat { get set }
```

## Mentioned in

Configuring a Physics Body

## Discussion

Discussion The actual unit is arbitrary as long as relative masses of objects are consistent throughout the game. The mass and density properties are interrelated. When you change the value of either property, the other property’s value is automatically recalculated to be consistent. The default value is 1.0.

## See Also

### Defining a Physics Body’s Physical Properties

- [Configuring a Physics Body](spritekit/configuring-a-physics-body.md)
- [mass](spritekit/skphysicsbody/mass.md)
- [area](spritekit/skphysicsbody/area.md)
- [friction](spritekit/skphysicsbody/friction.md)
- [restitution](spritekit/skphysicsbody/restitution.md)
- [linearDamping](spritekit/skphysicsbody/lineardamping.md)
- [angularDamping](spritekit/skphysicsbody/angulardamping.md)
