Get Next Sibling gameobject(transform) Method in unity3d C#

7.4k Views Asked by At

looking a method or a Library for something like this:

GameObject nextBrotherNode= gameObject.transform.getNextSibling();
1

There are 1 best solutions below

2
On BEST ANSWER

You mean

int index = transform.GetSiblingIndex();
GameObject nextBrotherNode = transform.parent.GetChild(index + 1).gameObject;