Version: Unity 6.7 Beta (6000.7)
Language : English
Add physics to a GameObject with 2D Physics Core
Create complex shapes with 2D Physics Core

Add physics to a sprite with 2D Physics Core

To add physics to a sprite GameObject and match the shape of the sprite for collisions, add a Physics Area Sprite component.

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.

Add a Physics Area Sprite component

To add the component, follow these steps:

  1. Select a GameObject with a Sprite Renderer component.
  2. In the Inspector window, select Add Component, then select Physics 2D (Core) > Physics Pose.
  3. Select Add Component again, then select Physics 2D (Core) > Physics Area Sprite.

Unlike other Physics Area components, the Physics Area Sprite component has no Geometry properties. Instead, the component copies the Custom Physics Outline of a sprite.

Edit the shape

To edit the shape the component uses, follow these steps:

  1. Select the sprite in the Project window.
  2. In the Inspector window, select Sprite Editor.
  3. In the dropdown, select Custom Physics Outline.
  4. Edit the shape. For more information, refer to Custom Physics Outline tab reference for the Sprite Editor window.
  5. To save your changes, select Apply.

If you add multiple shapes but the physics object has fewer shapes than you expect, check the Rejected Shape Count property in the Info section of the Physics Area Sprite component. If Unity rejected shapes, check the custom physics outline for unneeded extra points on a straight line, or points that are too close together.

Additional resources

Add physics to a GameObject with 2D Physics Core
Create complex shapes with 2D Physics Core