November 2019
Intermediate to advanced
404 pages
12h 9m
English
Canvases can be used for UI interactions in both 2D and 3D. This is determined by whether the Canvas has its Render Mode setting configured to Screen Space (2D) or World Space (3D). Any time a UI interaction takes place, the Canvas Component will check its eventCamera property (exposed as Event Camera in the Inspector window) to figure out which camera to use. By default, a 2D Canvas will set this property to the main camera, but a 3D Canvas leaves it set to null. This is unfortunate because, each time the event camera is needed, it will still use the main camera, but will do so by calling FindObjectWithTag(). Finding objects by tag isn't as bad of a performance cost as using the ...
Read now
Unlock full access