BCE0022 Cannot convert 'function(): String' to 'String'.

Hello. I am new to Unity, so sorry if I am asking an obvious question. I am getting an error when running this code:

function Update () {
	
	var camPosY = Camera.main.transform.position.y;
	guiText.text = camPosY.ToString;
	
}

I get this error:
Assets/Display.js(9,32): BCE0022: Cannot convert ‘function(): String’ to ‘String’.

Please help :slight_smile:

Thanks in advance :smiley:

Change this

guiText.text = camPosY.ToString;

to this

guiText.text = camPosY.ToString();

Note the parentheses indicate a function call.

You forgot the parenthesis :wink:

guiText.text = camPosY.ToString();

(the error was telling you that you were trying to assign a function to a string value)