# GetArrayElementAtIndex(int)

> Returns the element at the specified index in the array.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor](/engine/6000.0/script-reference/unityeditor.md)
* **Assembly:** UnityEditor

```csharp
public SerializedProperty GetArrayElementAtIndex(int index)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)):&#x20;

### Returns

| Type                                                                                    | Description |
| --------------------------------------------------------------------------------------- | ----------- |
| [SerializedProperty](/engine/6000.0/script-reference/unityeditor/serializedproperty.md) |             |

### Remarks

Additional Resources: [SerializedProperty.isArray](/engine/6000.0/script-reference/unityeditor/serializedproperty/isarray.md), [SerializedProperty.arraySize](/engine/6000.0/script-reference/unityeditor/serializedproperty/arraysize.md), [SerializedProperty.Next](/engine/6000.0/script-reference/unityeditor/serializedproperty/next.md).

### Examples

```csharp
using UnityEditor;
using UnityEngine;

public class ArrayExample : ScriptableObject
{
    public int[] m_data;

    [MenuItem("Example/SerializedProperty GetArrayElementAtIndex Example")]
    static void Example()
    {
        ArrayExample obj = ScriptableObject.CreateInstance<ArrayExample>();
        obj.m_data = new int[] { 3, 2, 1 };

        SerializedObject serializedObject = new SerializedObject(obj);
        SerializedProperty property = serializedObject.FindProperty("m_data");

        for (int i = 0; i < property.arraySize; i++)
        {
            SerializedProperty element = property.GetArrayElementAtIndex(i);

            //Will print
            //m_data.Array.data[0] : 3
            //m_data.Array.data[1] : 2
            //m_data.Array.data[2] : 1
            Debug.Log(element.propertyPath + " : " + element.intValue);
        }
    }
}
```
