I keep getting this error after trying multiple things, now I’m doing this and it still seems to give me the same error, how can I fix this or what am I doing wrong?
I need the array to contain 6 floats but Unity isn’t even allowing me to print them.
error:
IndexOutOfRangeException: Array index is out of range.
Molecule.Start () (at Assets/Scripts/Molecule.cs:7)
code:
using UnityEngine;
using System.Collections;
public class Molecule : MonoBehaviour {
public float [] Direction = {0, 60, 120, 180, 240, 300};
void Start(){
print (Direction[0] + " + " + Direction[1] + " + "+ Direction[2]);
}
}