Build the player

Keyboard Shortcuts

In this video, Jesse Freeman teaches you how to build a simple player for your game. You'll learn how to create a player prefab as well as how to attack basic physics logic to the player in your Unity scene. Learning how build a player GameObject in Unity 5 is an import skills for building a 2D game.

- [Voiceover] Now that we have our levels set up,…our spawner working, and the object pool working as well,…it's time for us to create a player for our game.…To do this, we're gonna set up…the animation for our player first.…Let's go into our Artwork folder and go…to our Sprite sheets and select a person.…Here we can unfold the texture and see all the sprites…that we cut out from the sprite sheet.…Let's drag sprites two through eight onto the scene.…Once we do this, Unity is gonna want us…to create a new animation for all of these sprites.…

In this case, let's call this PlayerRunAnimation,…and we're gonna open this up and create…a new folder now for all of our animation.…Then let's save the PlayerRunAnimation…into the Animations folder.…Now if we run our game, we'll see that our player…has his run animation in place.…Next we'll want to clean this up.…Let's rename this to Player,…and next we're gonna want to add…the physics objects we need to make this work.…

We'll start with the Box Collider 2D.…Now as you can see, the Box Collider…

Resume Transcript Auto-Scroll

Author

Released

8/22/2016

Learn everything you need to get started in Unity 2D game development. Unity expert Jesse Freeman builds a complete 2D game based off the endless runner genre—a unique one-button game that's not only fun to play, but also exciting to build. The end result is a reusable code base that you can extend with your own artwork and narrative.

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.