Transform child out of bounds

Hello. Can you help me with error transform child out of bounds? It doesnt work and I dont know why…

You code is making lots of fixed assumptions on children being there, having specific components etc. The fact that you’re posting here would suggest that you’ve verified that your “itemObject” meets these assumptions?

Try breaking your line down to “var obj = itemObject.transform.GetChild(0)”. If this is saying it’s out of bounds then it’s because there are no children. Transform.childCount would verify this.

1 Like

thank you very much