You’re gonna have to debug this yourself, since you have the entire scene set up.
Try this approach:
Before the offending lines of code on the transform boundaries, print out the transform.childCount value, and also print the value you are using for child number. Obviously the latter exceeds the former, based on the error.
Optionally iterate all of them and print their names, and while you’re at it, print the name of the GameObject this script is on, because you might have mis-dragged it onto another GameObject.
Hey man, thanks for the reply but i am kinda new to Unity so, do you mind like explaining it, I was following a tutorial for this code as I wasn’t sure how to create a basic log in system, so here I am, trying to debug, but completely dumbfounded.
You can output stuff to the console with Debug.Log() and that can give you a LOT of intel about what is going wrong.
You can also pause the editor in code at a particular point with Debug.Break();, such as precisely when your ship fires a bullet, for instance.
If you feel adventurous, you can have Visual Studio or Monodevelop attach to Unity, then you can actually set true breakpoints and debug that way, inspect the call stack, variables, etc.