Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
Rigid bodies work in 2D much the way they do in 3D. Once we've got our colliders on, in this case boxes and polygon colliders, we can put rigid bodies on some of the cars. Letting them fall after they're collided with. I'll start out by picking this green car in the middle. It's already got a polygon collider on it. And I'll choose Component > Physics 2D > Rigid Body 2D. In here in the rigid body, we've got many of the same parameters we do for 3D, mass, drag, and so on. What I'll do, is to start this out as asleep, meaning it doesn't do anything and doesn't fall until it's knocked into.
I'll leave mass and gravity alone and see how it behaves once I get it into my scene correctly. Next, I'll pick this other single car, and choose component. Physics 2D and rigid body. And again I'll make this car start asleep. This car already has a polygon collider on it. And I'm going to let it simply start animating and keep going, knocking into that green car and knocking it down. Finally, I'll take this trio of cars with a box collider and on to them I'll get another rigid body. Here in the rigid body I'll start out asleep and for these I'm going to make their mass a little bit bigger.
Now these will go down and hit the box collider at the bottom and this box collider on these several cars is not going to get a rigid body. I don't want it to fall down. I want it to stay fixed and so I'm going to leave it alone as just a box collider. This way, when the player triggers this car, it will knock into this one and this one will fall, as will that one. They'll get the idea that they've disturbed or upset the painting by getting close to view it. In addition to our rigid bodies, then We can do thing like putting on our hinges.
Looking at spring joints, distance and sliders. Allowing us to link objects together in 2D to make things like chains. The new one here is a distance joint. And what this let's do is have two objects that maintain a fixed distance from each other, but still react as if they're. Pin together. This opens up a lot of fun actually in 2D because you can let things happen and start to fling things around. If you'd like to make your own version of angry birds for example. A classic game of well loading up birds and flinging them at pigs and structures you can.
Enabling the physics in 2D is a great way to get going. And we'll start here with this painting. Getting ready for those cars to collide and start to fall.
Get unlimited access to all courses for just $25/month.Become a member
107 Video lessons · 34041 Viewers
94 Video lessons · 23773 Viewers
100 Video lessons · 4234 Viewers
83 Video lessons · 9288 Viewers
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.
Your file was successfully uploaded.