Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save oviniciusfaria/139a1239adf787a3cef8e521db7f84b0 to your computer and use it in GitHub Desktop.
Save oviniciusfaria/139a1239adf787a3cef8e521db7f84b0 to your computer and use it in GitHub Desktop.
Set Camera on Canvas->Render Camera - Unity 3D
//Set Camera on Canvas->Render Camera - Unity 3D
void Start()
{
Canvas canvas = gameObject.GetComponent<Canvas>();
canvas.renderMode = RenderMode.ScreenSpaceCamera;
canvas.worldCamera = Camera.main;
}
@oviniciusfaria
Copy link
Author

@ArtHubX cool! how good it helped you, my friend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment