# CameraTransformWorldToPanelRect(IPanel, Vector3, Vector2, Camera)

> Transforms a world position and size (in world units) to their equivalent local position and size on given panel, using provided camera for internal WorldToScreen transformation.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.UIElements](/engine/6000.5/script-reference/unityengine/uielements.md)
* **Assembly:** UnityEngine.UIElementsModule

```csharp
public static Rect CameraTransformWorldToPanelRect(IPanel panel, Vector3 worldPosition, Vector2 worldSize, Camera camera)
```

### Parameters

**** (\[IPanel]\(/engine/6000.5/script-reference/unityengine/uielements/ipanel)): The local coordinates reference panel.**** (\[Vector3]\(/engine/6000.5/script-reference/unityengine/vector3)): The world position to transform.**** (\[Vector2]\(/engine/6000.5/script-reference/unityengine/vector2)): The world size to transform. The object in the panel will appear to have that size when compared to other 3D objects at neighboring positions.**** (\[Camera]\(/engine/6000.5/script-reference/unityengine/camera)): The Camera used for internal WorldToScreen transformation.

### Returns

| Type                                                        | Description                                                                                            |
| ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
| [Rect](/engine/6000.5/script-reference/unityengine/rect.md) | A (position, size) Rect in panel coordinates that corresponds to the provided world position and size. |
