Version: Unity 7.0 Alpha (7000.0)
LanguageEnglish
  • C#

PhysicsWorld.drawDepth

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

public float drawDepth;

Description

The depth that custom drawing is drawn at when it is not tied to a body, in world space, along the axis perpendicular to the transform plane.

Custom drawing of geometry, points and lines has no body to take a depth from, so it is drawn at this depth. Set the depth before performing the custom drawing it applies to. The depth axis is Z for PhysicsWorld.TransformPlane.XY, Y for PhysicsWorld.TransformPlane.XZ and X for PhysicsWorld.TransformPlane.ZY. Drawing that belongs to a body, such as a body, shape or joint being drawn by the world, uses the depth of that body instead. See PhysicsBody.drawDepth. A value that is not finite is rejected and leaves the depth unchanged. The depth stays as set until it is changed or PhysicsWorld.ClearDraw is called, which resets it to zero.