In order to create a prefab, you must first have a collection of GameObjects that you want to keep together as one prefab.
Perform the following steps:
Navigate to the
Assets
folder. Right-click on it and select Create and then Folder. Name thisPrefabs
.Select the Axe GameObject in Hierarchy. This is the one we created in the last chapter. Click on it and drag it onto the
Prefabs
folder.
This will create an Axe prefab that we can use in the future that holds everything the current Axe GameObject does.
Anytime in the future, when we want to create an axe, we will have a complete file that holds everything we know as axe.
This is essentially all it takes to create prefabs. These are an incredibly simple and useful aspect of creating games with Unity.