Fables Alive
Fables Alive

Reputation: 2810

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

looking a method or a Library for something like this:

GameObject nextBrotherNode= gameObject.transform.getNextSibling();

Upvotes: 8

Views: 7643

Answers (1)

Benjamin James Drury
Benjamin James Drury

Reputation: 2383

You mean

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

Upvotes: 14

Related Questions