Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

world space constant size

public float downScaling; // to configure the size
private float _distance;
private Canvas _canvas;

private void Update()
{
	_distance = Vector3.Distance(_canvas.transform.position, _canvas.worldCamera.transform.position);
    _canvas.transform.localScale = Vector3.one * _distance / downScaling;

    _canvas.transform.LookAt(_canvas.worldCamera.transform); // canvas content needs to be flipped 180°
}
 
PREVIOUS NEXT
Tagged: #world #space #constant #size
ADD COMMENT
Topic
Name
3+5 =