The error resulted from the following c# code:
void Update () {
if(Input.GetMouseButtonDown(0)){
print( String.Format("mouse position: %f %f %f",
Input.mousePosition.x,
Input.mousePosition.y,
Input.mousePosition.z));
}
}
I thought String class would always be available since it is included in the System namespace? I am learning C# right now and I know Java and Javascript already.
The System namespace isn’t imported automatically; use System.String.Format. You can import System, but it can create conflicts (such as System.Random vs. UnityEngine.Random), so unless you’re using a lot of stuff in System, it’s often better just to specify System manually.
(By the way, “%f” is not anything that works in .NET; you might want to look up .NET string formatting examples.)
Try using string.Format
if that’s not working.