This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A simple Unity example script that makes a UI component track position of world space object rendered with | |
// specific world space camera. Canvas needs to be in Screen Space Camera mode. | |
[ExecuteInEditMode] | |
public class UIFollow : MonoBehaviour | |
{ | |
[Tooltip("World space object to follow")] | |
public GameObject target; | |
[Tooltip("World space camera that renders the target")] | |
public Camera worldCamera; | |
[Tooltip("Canvas set in Screen Space Camera mode")] |