Configure how Unity draws 2D physics objects in the Unity Editor or at runtime, and draw your own shapes.
Read time 3 minutesLast updated 16 days ago
To help you visualize 2D physics objects during development, Unity automatically draws the shapes you create with 2D Physics Core components in the Unity Editor. You can edit physics objects directly in the
Scene
?
view.
Note
This documentation is about using Pose, Area, and Constraint components. To use 2D physics in the Unity Editor using components like the Rigidbody 2D component, refer to 2D physics instead.
Note
Unity only draws 2D Physic Core shapes on platforms that support compute shaders.
Moving or rotating an area updates the Transformation properties of the Physics Area component. The geometry itself doesn't change. To update the geometry instead, use the Geometry Editing properties in Preferences. For more information, refer to 2D preferences tab reference.
Note
A body's mass comes from the geometry attached to it. Moving the geometry off the body's origin moves where the mass sits, so the body rotates and balances around the new point instead of its origin.
Edit a pose
To edit the pose instead of the area, select Edit Physics Pose (
Edit Physics Pose icon
) in the Physics Core Tools overlay.
Edit a constraint
To edit a constraint, select Edit Physics Constraint Anchors (
Edit Physics Constraint icon
) in the Physics Core Tools overlay.
Drag the square handles to move the anchor points of the constraint.
Configure visualization colors and sizes
To configure the colors and sizes of the shapes, use either of the following:
In the Physics Area component of the GameObject, select Definition > Surface Material > Custom Color.
Go to Edit > Preferences, then select 2D > Physics Core.
Visualize in a development build
To enable Unity drawing 2D Physics Core shapes in a development build, follow these steps:
Make sure your target build platform supports compute shaders.