Page 1 sur 1

[DB-AL] Erreur IndexOutOfRangeException

Publié : 24 Oct 2019 21:14
par MtKuma
Merci beaucoup tout le monde !!

le tuto de tower défense, je suis a la fin de l’épisode 2 et personnellement j'ai une erreur:
IndexOutOfRangeException: Index was outside the bounds of the array.
Enemy.Start () (at Assets/Enemy.cs:15)

NullReferenceException: Object reference not set to an instance of an object
Enemy.Update () (at Assets/Enemy.cs:20)
quelqu'un peu mexpliquer ?

Re: [DB-AL] Erreur IndexOutOfRangeException

Publié : 24 Oct 2019 21:28
par Alesk
MtKuma a écrit :
24 Oct 2019 21:14
Merci beaucoup tout le monde !!
IndexOutOfRangeException: Index was outside the bounds of the array.
Enemy.Start () (at Assets/Enemy.cs:15)
ligne 15 de ton script, tu essayes d'accéder à un index en dehors de la plage attribuée à un array
MtKuma a écrit :
24 Oct 2019 21:14
NullReferenceException: Object reference not set to an instance of an object
Enemy.Update () (at Assets/Enemy.cs:20)
ligne 20, tu essayes d'effectuer une action sur un objet, mais la valeur de la variable est égale à 'null'

Va falloir bien bosser les bases avant de te lancer dans des trucs compliqué ;)