From the course: Unity 3D: Lunchtime Lessons

Unlock the full course today

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

Scripting interactivity

Scripting interactivity - Unity 3D Tutorial

From the course: Unity 3D: Lunchtime Lessons

Start my 1-month free trial

Scripting interactivity

- [Instructor] Hi there, this week we're going to do scripting for interactivity. Now I've already set up a scene last week, where we did animation and the animation triggers. So what we have here, is I have this refrigerator. And if I go over to the animator window here and keep my game window open, if I press play, you'll see that each one of these objects here has what's called animation triggers. So for example, if I select the door left and click open, it opens and it closes. And the same goes for all of these different doors. Now the one thing I did with this, is I actually named all of these Open and Close. And that's going to be really important when we do the script because we're going to reference these names. So what I want to do is I want to create a collider for these doors and drawers, and then tie that to the mouse clicking down. So let's go into our scene here. And so the first thing I want to do…

Contents