Created
August 29, 2017 19:22
-
-
Save oviniciusfaria/139a1239adf787a3cef8e521db7f84b0 to your computer and use it in GitHub Desktop.
Set Camera on Canvas->Render Camera - Unity 3D
This file contains hidden or 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
//Set Camera on Canvas->Render Camera - Unity 3D | |
void Start() | |
{ | |
Canvas canvas = gameObject.GetComponent<Canvas>(); | |
canvas.renderMode = RenderMode.ScreenSpaceCamera; | |
canvas.worldCamera = Camera.main; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for the great solution;)