Hello Everyone, How would I check if an element in an array existed. I am using a 3 dimensional array, and if the the element at the 3 indices is undefined it should tell me that it doesn't exist. Ive looked all over the internet but nothing has worked. Thanks, Austin
Are you just talking about checking for null? I wouldn't think so, if you're using 3D arrays, but I don't know what else you'd be talking about. Code (csharp): void Awake () { Object[,,] objects = {{{this, null}}}; Debug.Log(objects[0,0,0]); // name of the script Debug.Log(objects[0,0,1]); // null } Using an if statement with a UnityEngine Object is easy, but some people take issue with the implementation, apparently: http://forum.unity3d.com/threads/102849-Remove-implicit-bool-cast-from-UnityEngine.Object!!