usually you'd type
gameObject.Find("someObject")
to find that object, but in my game I'm using
gameObject.Find(string1)
where string one is the name of a game object. Like this:
string1 = "First Person Controller";
string2 = "FPSWalker";
gameObject.Find(string1).transform.GetComponent(string2).some Function();
however I get the following error:
Assets/Scripts/TerrainScript.js(34,48): BCE0017: The best overload for the method 'UnityEngine.GameObject.Find(String)' is not compatible with the argument list '(char)'.
it doesn't make any sense to me because I'm just replacing a string with a string variable, why does it not work?!