Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

IndexOutOfRangeException: Index was outside the bounds of the array.

Discussion in 'UGUI & TextMesh Pro' started by SrConsole, Apr 3, 2020.

  1. SrConsole

    SrConsole

    Joined:
    Apr 3, 2020
    Posts:
    2
    IndexOutOfRangeException: Index was outside the bounds of the array.
    PlayerController.FixedUpdate () (at Assets/scripts/PlayerController.cs:34)

    ( i speak spanish so it is a little hard for me to write code perfectly)

    ( i was trying to get some kind of mario galaxy / pikmin game (which the gravity always follows the closest world)
     

    Attached Files:

    Last edited: Apr 3, 2020
  2. MartinIsla

    MartinIsla

    Joined:
    Sep 18, 2013
    Posts:
    72
    I speak Spanish too. Hola!

    That means the planetas array is empty. It's public, so I assume you wanted to assign the values in the inspector and forgot. Happens all the time :)

    (Completely wrong forum section, by the way, this is for UI!)
     
  3. SrConsole

    SrConsole

    Joined:
    Apr 3, 2020
    Posts:
    2
    ou lo siento soy nuevo y jamas habia preguntado nada aqui
     
unityunity