‫A very fundamental functionality in unity is the functionality of components.
‫And components are a super powerful tool.
‫They allow us to add functionality or looks or physics to an object.
‫So, for example, our player has a transformed component.
‫He has a sphere component, sphere measure and the rigid body and so forth.
‫And those components, they add functionality and looks to our player.
‫That's a very important aspect that you need to understand because every time that you want to add,
‫let's say, a different kind of behavior.
‫So let's say now we have player movement, but what you would like to have is player shooting so that
‫our player can shoot.
‫Then you would create a new component and that would be a script component and you would create a new
‫script or even here a new script and you would create a new script here.
‫Then you can have different components added to your object.
‫For example, you could add effects.
‫So what particle system to your object?
‫Or you could add even more physics, because so far we have only are a rigid body, we have our sphere
‫collider and those kind of things.
‫And what if you wanted to, you could add even an additional collider to our sphere, you could add
‫a box collider.
‫So as you can see now, our player has two different colliders, the Box and the Sphere.
‫Collider And that's a new component.
‫You can add components as you need them, and you can remove those components any time.
‫And what you also can do is you can copy components and add them to a different object.
‫So for example, if I would like to have this player movement component in a different object, I could
‫copy the component here called the component and add it, for example, to our game object.
‫So in here I would press there and paste component as new.
‫So press this little button here at the top, paste component as new, and then you have the player
‫component here as well.
‫Well, it doesn't make sense for that game object, so I'm just going to remove the component again.
‫Then if you would like to change the order of your components, you can simply move them up, for example.
‫So if I want to move this up, this player movement component, I can press and move up.
‫And as you can see, this action can break the prefab instance there.
‫Are you sure you want to continue and I'm just going to use cancel.
‫So let's do the same thing with the prefab.
‫Let's go to our player and let's move it up now.
‫So as you could see now, it wasn't very happy with changing that.
‫So if you want to move something up, for example, move a component up, do that with your prefab and
‫not with its instance in the hierarchy, because that player here is not the same as that player there.
‫This is the prefab and that one is the player itself.
‫So if you make any changes to your player instance within your hierarchy, you can apply it.
‫So let's say our player here has its player movement control component at the second lowest spot or
‫a third low spot, depending on what you consider as a component.
‫And that one has a speed of, let's say, 100.
‫So our player prefab has a speed of 100.
‫Our player itself now took over that, but we could change it here so we could change the speed of our
‫player to 20.
‫Our player prefab, however, would not be influenced by that.
‫So let's have a look at that if we want to apply this.
‫So if we want to save the information that we have changed in here and save them to our prefab, we
‫need to click apply.
‫All right.
‫So that's very important.
‫If you want to make any changes and apply them, press on apply.
‫And now our player prefab itself will also have the speed of 20.
‫All right.
‫So that's about components and a bit more on prefabs.