From the course: Unity: Architectural Visualization Interactivity

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Completing object interactions

Completing object interactions - Unity Tutorial

From the course: Unity: Architectural Visualization Interactivity

Start my 1-month free trial

Completing object interactions

- [Instructor] In this movie we're going to complete our door interaction so that finally we can click on the door to open it, and if we want, we can click on it again to close it. In selecting the door and taking a look at the inspector, you can see we have our interact object script and the on-selected event is currently empty. What do we need to do inside that event? Essentially we need to trigger the door open, or close animation. You'll recall, back at the beginning of this chapter, inside the animator, we created this triad of animation states. Closed, open, and closing, and we can use this parameter here, the door change parameter, to open and close the door as needed. So we're gon' be setting this parameter inside this selected field. To do that, I can simply choose to add a new event here inside this field, I can drag and drop the animator into this slot, the same animator on this object and then from the…

Contents