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 answers

2
Benjamin James Drury On BEST ANSWER

You mean

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