Unity 2D Game Development by Unknown

Unity 2D Game Development by Unknown

Author:Unknown
Language: eng
Format: epub, mobi, pdf
Publisher: Packt Publishing


So what was the point of creating the death trigger in a different way before? The answer is that we could show you multiple ways to handle 2D collisions. You're welcome!

Making the world bigger

Now that your player can jump around the world, let's give them a few more platforms to jump on. First things first, let's make that platform standard. Let's create a Prefab with it. In the Project tab, create a folder called Prefabs. Now, drag-and-drop the Platform into the Prefabs folder to automatically turn it into a Prefab. Now you can go ahead and place more platforms around the scene by dragging and dropping the platform from the Prefabs folder into the scene, spacing them so the player can jump between them. This is the power of Prefabs. Because now if we need to change the platform, we simply change the one in the Project tab and all placed platforms in the game world will automatically update with the changes.

Let's keep this organized. Create a new empty GameObject and name it Platform Container. In the Hierarchy tab, drag-and-drop all of the platforms into this new object, making them children of it, as shown in the following screenshot:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.