Hello! im working on a game right now, and while i was working on code for being able to register accounts, i saw an error pop up saying: “Transform child out of bounds” here is my current code:
please help and tell me what im doing wrong! thanks
Hello! im working on a game right now, and while i was working on code for being able to register accounts, i saw an error pop up saying: “Transform child out of bounds” here is my current code:
please help and tell me what im doing wrong! thanks
It means the child you’re trying to access doesn’t exist.
If you call GetChild(3) you’re trying to access the 4th child. You can check the amount of children with transform.childCount.
thanks!
but also where should i put the child in my code? i dont know where it should go
I assume you copied this code from somewhere and are trying to make it work for your game?
Well I don’t see any Instantiating in that code so you’ll need to fill the public gameobjects fields with gameobjects which have these amounts of children attached in the editor etc. You can also see what components you’ll need to add to those gameobjects by looking for the getcomponent parts in the code.