Ray casts and line of sight tests help you identify whether objects are seen or unseen, or are nearer to the camera. This is useful for creating interactive objects, like buttons, doors, and windows. These objects need to respond to user input when approached.
In this video, we're going to take a look … at how the object selector script … which is attached to the viewers camera. … We're going to look at how that script … can figure out which object we're looking at. … And the way it's going to do that, … is by using a Physics Raycast. … Now in the preceding movie, … one of the things that I mentioned … that was critically important … for all of the interactable objects in the level, … is that they're all going to be on the same layer. … I'm going to assign our interactive door … to the relevant layer right now. … So I'm going to minimize Visual Studio, … and then move out here and select our door … at the end of the corridor here. … Just left-click to select that door, … and it's selected here, … inside the hierarchy panel. … Now in selecting that door, … I'm going to move up to the Inspector here … and check out which layer it's on. … By default, it's on the default layer. … That's the normal layer of all newly-created objects, … and right now it's the layer that this door is on. …
Skill Level Intermediate
Unity: AR Visualization 01 Basic Conceptswith Roger Miller1h 59m Intermediate
Unity: AR Visualization 02 Basic Interactivitywith Roger Miller2h 39m Intermediate
Cert Prep: Unity Scripting and Publishingwith Alan Thorn2h 3m Intermediate
1. Configuring an Architectural Visualization Scene
2. Area-Based Interactions
3. Doors and Object Interactions
4. Camera Controls
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.