Merge 2D Physics Core shapes
Physics Pose component reference
Visualize and edit 2D Physics Core scenes
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.
Edit an area
To edit an area, follow these steps:
- Make sure the Tools overlay is visible in the Scene view. For more information, refer to Default Scene view overlay reference.
- Select the GameObject that has a Physics Area component.
- In the Tools overlay, in the Physics Core Tools overlay, select Edit Physics Area (
).
Use the following to edit the geometry:
- To move the geometry, hold Shift (macOS: Cmd), then click and drag the circular handle in the center.
- To rotate the geometry, hold Shift (macOS: Cmd), then click and drag the handle on the angle line next to the center.
- To resize or stretch the geometry, click and drag the circular or rectangular handles on the edges.
For shapes with points, such as polygons, contours, and paths, use the following:
- To move a vertex, click and drag a square handle.
- To remove a vertex, hold Shift (macOS: Cmd), then click a red square handle.
- To add vertices, hold Shift (macOS: Cmd), then click a white square handle.
- To round the corners, click and drag the single circular handle on the edge of the shape.
- To change the winding order of a contour or path, use the winding control in the Geometry section of the Inspector.
You can’t edit the shape of a sprite directly in the Scene view. For more information, refer to Add physics to a sprite with 2D Physics Core.
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 (
) in the Physics Core Tools overlay.
Edit a constraint
To edit a constraint, select Edit Physics Constraint Anchors (
) 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.
- Create and assign a Physics Core Settings 2D asset. For more information, refer to Configure global Physics Core 2D API settings.
- In the Project Settings window, select Physics Core 2D > Settings.
- Select the Global tab.
- Set Rendering Mode to Development Player or Any Player.
Additional resources
Merge 2D Physics Core shapes
Physics Pose component reference