From the course: Unity 2023 Essential Training

Applying Colliders

- [Instructor] All right, so let's go ahead and add colliders throughout our scene. So the first one I absolutely want is the countertop here, so when the ball falls, it actually bounces off the counter. So let's go ahead and add this one. And for this one, I'm going to use the Box Collider. Perfect. And if you want to see what you just added, you just click on this icon here and you're going to see the collider here. We'll work on it in the next video. For now, just let's just add it across. So we're going to add one to our floor. And because our floor has multiple elements, you want to make sure you select not just the tile but the entire wooden floor, like so. Let's add a component. And for this one, box as well. Then we're going to add colliders for the walls here, just make sure we're not walking through the walls. A component. And for this one, I'm going to add a mesh. Mesh Collider. Same thing for all the other walls. The ceiling. We could add the Box Collider for this one since it's very square. Box Collider. To this wall, I'm going to add a Mesh Collider. When the shapes are not even or when you're not sure, add a Mesh Collider, actually is shaped by the object itself. When there's something that is squared like this, add a Box Collider. For the chair, I'm going to use the Capsule Collider. Chair instance, chair instance. Capsule Collider. Chair. Capsule Collider. These walls, same thing. I'm going to add a Mesh Collider for this one. For this one, same thing, Mesh collider. You get the gist of it. Mesh Collider. So I got the ceiling, I got the walls, I got the floor, I got the main objects here that I truly want this ball to bounce off. Now, let's take a look at the one here. So I want to take a look at the counter because this is the one that's important, where the ball is going to fall. And let's add these icons to make sure, as you can see, it's a bit weird. Right now, it's way too large. And we're going to work on these in the next video. So this is how we add colliders to all the elements in your scene. Feel free to add some more as you see fit, but this is how you work with colliders. Let's move on.

Contents