# drawDepth

> The depth this body is drawn at, in world space, along the axis perpendicular to the world's transform plane.

## Definition

* **Type:** Property
* **Namespace:** [Unity.U2D.Physics](/engine/6000.7/script-reference/unity/u2d/physics.md)
* **Assembly:** UnityEngine.PhysicsCore2DModule

```csharp
public float drawDepth { get; set; }
```

### Remarks

Bodies are drawn in two dimensions, so the depth is what places a body in front of or behind other things in the scene. The depth axis is Z for [PhysicsWorld.TransformPlane.XY](/engine/6000.7/script-reference/unity/u2d/physics/physicsworld/transformplane/xy.md), Y for [PhysicsWorld.TransformPlane.XZ](/engine/6000.7/script-reference/unity/u2d/physics/physicsworld/transformplane/xz.md) and X for [PhysicsWorld.TransformPlane.ZY](/engine/6000.7/script-reference/unity/u2d/physics/physicsworld/transformplane/zy.md). The depth is only used when the body has no [PhysicsBody.transformObject](/engine/6000.7/script-reference/unity/u2d/physics/physicsbody/transformobject.md). A body with a transform object is always drawn at the depth of that transform. Everything drawn for the body, such as its shapes and its transform axis, uses this depth. A joint is drawn at the depth of its first body, [PhysicsJoint.bodyA](/engine/6000.7/script-reference/unity/u2d/physics/physicsjoint/bodya.md). A value that is not finite is rejected and leaves the depth unchanged. The depth only changes how the body is drawn and never affects the simulation. See [PhysicsBodyDefinition.drawDepth](/engine/6000.7/script-reference/unity/u2d/physics/physicsbodydefinition/drawdepth.md). To set the depth for custom drawing that is not tied to a body, use [PhysicsWorld.drawDepth](/engine/6000.7/script-reference/unity/u2d/physics/physicsworld/drawdepth.md).
