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 Raycasters

As stated earlier, if you want to use the Event System with a non-UI object, you must attach a Raycaster to a camera within the scene. You can add either a Physics 2D Raycaster or a Physics Raycaster (or both) to your camera based on whether you are using 2D or 3D.

From within the camera's inspector, you can add the Physics 2D Raycaster by selecting Add Component | Event | Physics 2D Raycaster and the Physics Raycaster by selecting Add Component | Event | Physics Raycaster.

The two components appear as follows:

The Event Mask property determines which types of objects can receive raycasting.

If you attempt to add either of ...

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