in this script:
the console gave me this error:
the colsole refer to this line -specially-:
what is the error? help, please!
in this script:
the console gave me this error:
the colsole refer to this line -specially-:
what is the error? help, please!
It means there is no gos[0].
GameObject.FindGameObjectsWithTag(“Player”) did not find any GameObjects with the tag “Player”
Exactly what it says - there is no object at the 0 index of that array, or more specifically - your array has no elements because you never gave it a length. The distinction between JavaScript arrays and .NET arrays is an important one: http://unity3d.com/support/documentation/ScriptReference/Array.html
This error means this line GameObject.FindGameObjectsWithTag("Player"); didn’t find any gameobject with the tag Player, so the array returned was empty
A simple…
if(gos.Length==0) return;
would fix this.
Or just use GameObject.FindGameObjectWithTag(“Player”); To not get a array at all. ( no s )
Thanks for all ッ