1 00:00:04,880 --> 00:00:08,990 ‫In this video, you will learn about physics basics in Unity 3D. 2 00:00:09,650 --> 00:00:11,240 ‫Let's have a quick overview first. 3 00:00:11,750 --> 00:00:18,200 ‫So the most important things are Rigid Body, Collider and Trigger, and we will have a look at each 4 00:00:18,200 --> 00:00:20,180 ‫of those separately. 5 00:00:20,690 --> 00:00:23,660 ‫So now let's have a look at the rigid body first. 6 00:00:24,320 --> 00:00:30,770 ‫The rigid body contains information and details about the mass of the object that contains this rigid 7 00:00:30,770 --> 00:00:31,280 ‫body. 8 00:00:31,610 --> 00:00:38,360 ‫Then it has a drag property which is like a damper, so it reduces the tempo to a certain degree. 9 00:00:38,360 --> 00:00:44,220 ‫For example, then the angular drag is similar, but attempts at rotation only. 10 00:00:44,660 --> 00:00:50,780 ‫Then we have the use gravity property which tells if our object is influenced by gravity or not. 11 00:00:51,830 --> 00:00:54,620 ‫Then we have is kinematic, which we can activate. 12 00:00:54,620 --> 00:01:01,250 ‫Then for example, our object is not influenced by physics, but it still influences other objects. 13 00:01:01,250 --> 00:01:08,540 ‫For example, this could be great for a wall, then interpolate makes sense for characters as otherwise, 14 00:01:08,540 --> 00:01:11,870 ‫animations and physics aren't calculated at the same time. 15 00:01:11,870 --> 00:01:18,800 ‫So what interpolate does is it uses more resources in order to really make sure that the physics and 16 00:01:18,800 --> 00:01:21,020 ‫animations work together quite well. 17 00:01:21,020 --> 00:01:25,760 ‫And that's not as important for other objects as it is for the main character. 18 00:01:26,540 --> 00:01:32,240 ‫Then you have the collision detection and finally the constraints which allows us to freeze the position 19 00:01:32,240 --> 00:01:33,920 ‫and freeze the rotation. 20 00:01:33,920 --> 00:01:39,860 ‫So for example, if you wanted our player or an object does not rotate, we can assign that. 21 00:01:39,860 --> 00:01:43,700 ‫It doesn't rotate to a specific angle or it doesn't rotate at all. 22 00:01:43,700 --> 00:01:45,920 ‫So we could freeze all of the rotations. 23 00:01:46,820 --> 00:01:50,960 ‫Then there are colliders and there are multiple colliders. 24 00:01:50,960 --> 00:01:56,660 ‫For example, the box collider, which makes sense for boxes or objects that have a similar shape as 25 00:01:56,660 --> 00:02:03,350 ‫a box, then the Sphere Collider which makes mainly sense for spheres and balls, and maybe the player 26 00:02:03,350 --> 00:02:05,750 ‫object if it has a form of a sphere. 27 00:02:06,170 --> 00:02:13,400 ‫The Mesh Collider is a very precise collider, which is based on the mesh of the game object, which 28 00:02:13,400 --> 00:02:19,880 ‫means it will be like a skin on top of the looks of the graphic itself. 29 00:02:19,880 --> 00:02:26,060 ‫So if a if we have a spaceship that has certain edges and so forth, the mesh collider would be a great 30 00:02:26,060 --> 00:02:26,900 ‫choice here. 31 00:02:26,900 --> 00:02:32,780 ‫Or if we have a player which has a very specific kind of form, a mesh collider would make sense. 32 00:02:33,320 --> 00:02:38,360 ‫Then you have the capsule collider, which makes sense for capsules, but also can be used very well 33 00:02:38,360 --> 00:02:40,280 ‫for players and the terrain. 34 00:02:40,280 --> 00:02:48,320 ‫Collider Which is used for the terrain of the game, for example, mountains and the ground and those 35 00:02:48,320 --> 00:02:49,130 ‫kind of things. 36 00:02:49,520 --> 00:02:52,130 ‫Let's have a look at something that each collider has. 37 00:02:52,130 --> 00:02:58,310 ‫There is something called is trigger, which allows us to make a object a trigger. 38 00:02:58,310 --> 00:03:01,760 ‫We'll have a closer look at triggers in the next slide. 39 00:03:02,090 --> 00:03:10,070 ‫Then you have something called material, which is a physics material which which adds things like friction 40 00:03:10,070 --> 00:03:12,680 ‫or bounce ness to our object. 41 00:03:13,220 --> 00:03:19,340 ‫Then we have the center, which is simply the center of our collider, the radius, which is for fear. 42 00:03:19,340 --> 00:03:24,590 ‫So if you want to change the size of the collider of a sphere, you would have to change the radius 43 00:03:24,590 --> 00:03:26,020 ‫of the collider. 44 00:03:26,030 --> 00:03:26,390 ‫All right. 45 00:03:26,390 --> 00:03:28,700 ‫Next, let's have a look at the trigger. 46 00:03:28,940 --> 00:03:37,580 ‫In order to use a game object or a physics collider as a trigger, you need to activate the trigger 47 00:03:37,610 --> 00:03:38,510 ‫property. 48 00:03:38,780 --> 00:03:40,460 ‫It deactivates colliders. 49 00:03:40,460 --> 00:03:46,280 ‫So whenever this trigger is activated, the surface is not like a warp. 50 00:03:46,280 --> 00:03:48,860 ‫It doesn't behave like a wall or a skin anymore. 51 00:03:48,860 --> 00:03:51,200 ‫So it can simply get passed through. 52 00:03:52,020 --> 00:03:57,680 ‫That is great, for example, for invisible walls that need to start an event when passed through. 53 00:03:57,690 --> 00:04:06,090 ‫So if you run through a specific wall or if you run through a sphere collider that is as is trigger, 54 00:04:06,090 --> 00:04:11,640 ‫then the enemy could start moving or the enemy could start shooting, or the enemy could be could be 55 00:04:11,640 --> 00:04:13,050 ‫created only at that point. 56 00:04:13,050 --> 00:04:17,790 ‫Or at least the animations could only start then, because before that they wouldn't be relevant, for 57 00:04:17,790 --> 00:04:19,920 ‫example, as they are too far away. 58 00:04:20,190 --> 00:04:23,010 ‫And it's also great for collectibles. 59 00:04:23,400 --> 00:04:27,990 ‫So now you should have an overview of the basics of physics. 60 00:04:28,050 --> 00:04:33,480 ‫In the next videos, we will have a look at each of those colliders and of trigger as well. 61 00:04:33,480 --> 00:04:34,710 ‫So see you there.