Hello, Is there a way to tell Unity to add more decimals to the Vector3.toString command? For example, I am doing: Code (csharp): value = object.transform.position.ToString(); And saving value to a file, which turns up to be something like (-3.5, 12.5, -9.5). However, I need more than one decimal of precision. Thanks for the help! EDIT. Sorry -- I didn't get much sleep last night. This was so easy that I feel that I insulted my intelligence! For anyone else who has this problem: Code (csharp): var x : float = transform.position.x; var y : float = transform.position.y; var z : float = transform.position.z; var formattedOutput = "(" + x + ", " + y + ", " + z + ")"; print(formattedOutput); You don't even need the var x, y, z, but whatever! Hope that helps other sleep-deprived people (or those who do not actually know how to do this.)
Since you can't get access to the ToString function you'd have to format it yourself: string.Format("{0:FX},{0:FX},{0:FX}", object.transform.position.x, object.transform.position.y, object.transform.position.z); Where X is the amount of decimal precision e.g. {0:F2} = 0.00
More elegant solution is: position.ToString("0.000") - the result will be like 5.123. Sorry for my English