In this video, Jesse Freeman teaches you how to make the player jump. Once you master the basics of 2D physics and 2D collision you'll be able to add a vertical force to your player in order to make them jump over obstacles in your game. Learning how build a player GameObject in Unity 5 is an import skills for building a 2D game.
- [Voiceover] Now we're ready to make the player jump.…Let's go into our Scripts folder…and create a new script called Jump.…When it comes to adding behaviors like Jump,…or moving forward, I like to break them out…into their own little scripts.…This way everything is reusable, and also,…it only has to focus on doing one simple task,…in this case, making our player jump.…We'll connect the player jump to the Input State…so that the jump class has some sort…of knowledge of what the player is doing,…without having to know really much about the player itself.…
Let's open this up in MonoDevelop.…At the top of our class, let's add a few properties.…First, we're gonna need a public float…that represents the jumpSpeed.…Here we'll set this to 240.…Next, we're gonna need a reference…to the RigidBody2D and the input state on the game object.…Let's create a private property for RigidBody2D…called Body2D, and we'll also create a private property…called InputState for the input state.…
Next, let's make a new Awake method,…and in it we'll set the Body 2D and Input State…
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.