<!--
{
  "availability" : [
    "Reality Composer Pro: -",
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "ComputeGraph",
  "identifier" : "/documentation/ComputeGraph/group/elementIndexInGroup",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Compute Graph"
    ],
    "preciseIdentifier" : "group::elementIndexInGroup"
  },
  "title" : "group::elementIndexInGroup"
}
-->

# group::elementIndexInGroup

Returns the index of the current element within its group.

```
int group::elementIndexInGroup()
```

## Return Value

The zero-based index of the current element within its group

## Discussion

Use this function to identify which particle within the group is being processed,
allowing you to create unique behaviors for different particles in the same group.

> Visual: ![Graph](group__elementIndexInGroup)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)