In this video, Jesse Freeman teaches you how to recycle the player's GameObject when they have moved off the screen or have been destroyed. Once the player is incorporated into the game's object pooling system it will be much easier to instantiate as needed. Learning how build a player GameObject in Unity 5 is an import skills for building a 2D game.
- [Voiceover] So, now before we move onto…actually putting the whole game together,…we want to clean up the last few things on the Player.…The first thing we'll do,…is we're gonna turn the Player…into a Prefab, by dragging him from the scene…into our Prefabs folder.…With our Player Prefab selected,…let's go in and add two more components.…The first component we're gonna want to create is…the Destroy Offscreen.…The other component we're gonna want to create is…the Recycle Game Object.…We've spent a lot of time building the basic foundation…for all of this to work.…
And it took a while to get here.…But now you can see,…in order for us to create recyclable Game Objects,…that take advantage of our Object Pool,…and can also be destroyed…when they're off screen and are smart enough to know…whether the Game Object needs to be recycled or not,…we simply just need to start adding…these little behaviors onto our component.…And because all of our code is incredibly modular…and self-sufficient, we're able to now,…make this reusable throughout the rest of our project,…
Start watching to learn how to convert artwork into sprites, create repeating background textures with Unity's TexturePacker, and build reusable game objects such as players, obstacles, and enemies. Jesse also covers the basics of object pooling, working with custom UI components, and multiplatform publishing.
- Importing artwork
- Editing sprites
- Creating repeating background textures
- Building reusable obstacles
- Recycling game objects
- Building an object pool
- Creating the player
- Starting and ending the game
- Displaying and saving the score
- Adding menus and text
- Publishing a Unity game in different formats
Skill Level Beginner
1. Working with Sprites
2. Creating Repeating Textures
3. Creating Obstacles
4. Object Pooling
5. Creating the Player
6. Setting Up the Game
7. Polishing the Game
8. Creating More Obstacles
Publish to different formats5m 42s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.