Answers for "unity object to screen position"

C#
2

unity object to screen position

public Transform target;
Camera cam;
    
void Start()
{
	cam = GetComponent<Camera>();      
    // gets position of object on screen
	Vector2 screenPos = cam.WorldToScreenPoint(target.position);
}
Posted by: Guest on February-05-2021

Code answers related to "unity object to screen position"

C# Answers by Framework

Browse Popular Code Answers by Language