Skip to Content
Mastering UI Development with Unity
book

Mastering UI Development with Unity

by Dr. Ashley Godbold
April 2018
Beginner content levelBeginner
468 pages
11h 7m
English
Packt Publishing
Content preview from Mastering UI Development with Unity

Other considerations when working in World Space

For the most part, working with UI in World Space isn't much different than working with UI in Screen or Camera Space. There are a few things you have to keep in mind, though.

When working with 3D scenes, you may want your UI to always face the player, regardless of how the player turns the camera—this is known as a billboard effect. You can achieve this with a simple LookAt() function on the transform of the object in the Update() function: 

transform.LookAt(2*transform.position-theCamera.transform.position );

You can use a variation of the preceding code, depending on how you want the rotation to behave.

Another consideration with 3D World Space UI is the distance it is away from the camera. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Game Development with Unity for .NET Developers

Game Development with Unity for .NET Developers

Jiadong Chen
Unity UI Cookbook

Unity UI Cookbook

Francesco Sapio

Publisher Resources

ISBN: 9781787125520Supplemental Content