Scripting is an essential part of Unity. Learn how to connect animation triggers to a mouse click to interactively open doors.
- [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 is create a collider. … So let's go ahead and select our door left, …
Updated
1/11/2021Released
10/5/2020Note: Because this is an ongoing series, viewers will not receive a certificate of completion.
Share this video
Embed this video
Video: Scripting interactivity