How to reverse a float value ?

hi everybody, i want to inverse the float value screenPosition.x form this GUI.Label(new Rect(screenPosition.x,Screen.height-50,100,20), Name);

the whole script:

var Name : String;
var font : Font;
var col : Color;

function Start()
{
}
function Update () 
{
}
function OnGUI()
{
	screenPosition = Camera.main.WorldToScreenPoint(Vector3(transform.position.x-0.2, transform.position.y+1, transform.position.z));	
	screenPosition.x = Mathf.Clamp(screenPosition.x, 20, Screen.width-75);
    screenPosition.y = Screen.height - screenPosition.y;
    screenPosition.y = Mathf.Clamp(screenPosition.y, 50, Screen.height);
	
	GUI.skin.font = font;
	GUI.color = col;
	var infront = transform.position - Camera.main.transform.position;
 
	if (Vector3.Dot(Camera.main.transform.forward, infront) > 0)
	{
		GUI.Label(new Rect(screenPosition.x-10,screenPosition.y-40,100,20), Name);
	}
	else
	{
		GUI.Label(new Rect(screenPosition.x,Screen.height-50,100,20), Name);
	}
}

thank you :slight_smile:

What do you mean “inverse” it? Like make it a negative number? You just put a - in front of it. But you can’t have negative screen positions.

If you mean move it to the other side of the screen from wherever it is now you can use:

screenPosition.x = Screen.width - screenPosition.x;

Thank you it work perfectly :smile:

Thank you, it helped me as well