# ToPosition3D

> Transform a 2D position into a 3D position using the selected transform plane. If PhysicsWorld.TransformPlane.Custom is used, PhysicsWorld.TransformPlane.XY will be used instead which may not provide the correct results.

## Definition

* **Type:** Method
* **Namespace:** [Unity.U2D.Physics](/engine/6000.5/script-reference/unity/u2d/physics.md)
* **Assembly:** UnityEngine.PhysicsCore2DModule

## ToPosition3D(Vector2, Vector3, TransformPlane)

Transform a 2D position into a 3D position using the selected transform plane. If [PhysicsWorld.TransformPlane.Custom](/engine/6000.5/script-reference/unity/u2d/physics/physicsworld/transformplane/custom.md) is used, [PhysicsWorld.TransformPlane.XY](/engine/6000.5/script-reference/unity/u2d/physics/physicsworld/transformplane/xy.md) will be used instead which may not provide the correct results.

```csharp
public static Vector3 ToPosition3D(Vector2 position, Vector3 reference, PhysicsWorld.TransformPlane transformPlane = TransformPlane.XY)
```

### Parameters

**** (\[Vector2]\(/engine/6000.5/script-reference/unityengine/vector2)): The 2D position to transform.**** (\[Vector3]\(/engine/6000.5/script-reference/unityengine/vector3)): The 3D position used as a reference.**** (\[TransformPlane]\(/engine/6000.5/script-reference/unity/u2d/physics/physicsworld/transformplane)): The transform plane to use.

### Returns

| Type                                                              | Description               |
| ----------------------------------------------------------------- | ------------------------- |
| [Vector3](/engine/6000.5/script-reference/unityengine/vector3.md) | The transformed position. |

## ToPosition3D(Vector2, Vector3, TransformPlane, TransformPlaneCustom)

Transform a 2D position into a 3D position using the selected transform plane.

```csharp
public static Vector3 ToPosition3D(Vector2 position, Vector3 reference, PhysicsWorld.TransformPlane transformPlane, in PhysicsWorld.TransformPlaneCustom transformPlaneCustom)
```

### Parameters

**** (\[Vector2]\(/engine/6000.5/script-reference/unityengine/vector2)): The 2D position to transform.**** (\[Vector3]\(/engine/6000.5/script-reference/unityengine/vector3)): The 3D position used as a reference.**** (\[TransformPlane]\(/engine/6000.5/script-reference/unity/u2d/physics/physicsworld/transformplane)): The transform plane to use.**** (\[TransformPlaneCustom]\(/engine/6000.5/script-reference/unity/u2d/physics/physicsworld/transformplanecustom)): The custom transform plane (if required).

### Returns

| Type                                                              | Description               |
| ----------------------------------------------------------------- | ------------------------- |
| [Vector3](/engine/6000.5/script-reference/unityengine/vector3.md) | The transformed position. |
