# Attach custom data to 2D Physics Core objects

> Attach values and physics masks to physics objects so you can fetch them later.

To attach custom data to a 2D Physics Core component, use the **User Data** section of the Editor window.

> **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](/engine/6000.7/manual/unity2d/2d-physics.md.md) instead.

Follow these steps:

1. Select a GameObject with any 2D Physics Core component.
2. In the **Inspector** window, expand the **User Data** section.
3. Set a value for one of the custom properties. For example, set **Int** to 42 to attach the integer value of 42 to the component.

To fetch the data in the API, get the `userData` property of the physics object. For example:

```csharp
Debug.Log(myShape.userData.intValue);
```

## Additional resources

* [Collisions and interactions in 2D Physics Core](/engine/6000.7/manual/unity2d/2d-physics-api/interactions.md)
* [Configure 2D Physics Core scenes](/engine/6000.7/manual/unity2d/2d-physics-api/properties.md)
* [PhysicsCore2D repository](https://github.com/Unity-Technologies/PhysicsExamples2D/tree/master) on GitHub
