# SGraphicRaycaster

**الأعضاء** 4

|       |                                             |                                                                                                                  |
| ----- | ------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| دالة  | [Raycast](#raycast)                         | Perform the raycast against the list of graphics associated with the Canvas and returns first UI raycast result. |
| خاصية | [SortOrderPriority](#sortorderpriority)     | Priority of the raycaster based upon render orderPriority of the raycaster based upon sort order.                |
| خاصية | [RenderOrderPriority](#renderorderpriority) | Priority of the raycaster based upon render order.                                                               |
| خاصية | [GameObject](#gameobject)                   | –                                                                                                                |

## الدوال

### Raycast

[SUIRaycastResult](/docs/ar/scripting/client-scripting-api-reference/types/suiraycastresult.md) Raycast()

Perform the raycast against the list of graphics associated with the Canvas and returns first UI raycast result.

القيم المرجعة

`SUIRaycastResult`

مثال

**Lua**

```lua
raycastResult = Space.Host.ExecutingObject.GraphicRaycaster.Raycast()

```

**Lua**

```lua
local trans = Space.Host.ExecutingObject
local canvas = Space.Host.GetReference("Canvas")
local gr = canvas.GraphicRaycaster
function Update()
    local raycast = gr.Raycast()
    Space.Log(raycast.ToString())
end
trans.OnUpdate(Update)

```

## الخصائص

### SortOrderPriority

int SortOrderPriority {get; }

Priority of the raycaster based upon render orderPriority of the raycaster based upon sort order.

مثال

**Lua**

```lua
Space.Host.ExecutingObject.GraphicRaycaster.SortOrderPriority= 1

```

### RenderOrderPriority

int RenderOrderPriority {get; }

Priority of the raycaster based upon render order.

مثال

**Lua**

```lua
Space.Host.ExecutingObject.GraphicRaycaster.RenderOrderPriority = 1

```

### GameObject

[SGameObject](/docs/ar/scripting/client-scripting-api-reference/types/sgameobject.md) GameObject {get; }

مثال

**Lua**

```lua
theGameObject = Space.Host.ExecutingObject.GraphicRaycaster.GameObject

```
