In this video, Jesse Freeman teaches you how to detect when the player is standing on the ground. Understanding the basics of physics and collision detection in Unity is key to add behaviors like running, jump and more to your player class. Learning how build a player GameObject in Unity 5 is an import skills for building a 2D game.
- [Voiceover] Now before we can actually make…the player jump,…we're going to need to know when the player…is actually standing on something solid.…In this case, we're going to build the most basic class…that will manage whether the player is in motion…or if the player is being stopped…by another physical object.…Let's go into our Scripts folder…and create a new C# Script called InputState.…Then let's open this up in MonoDevelop.…Now the idea behind the InputState…is that we're going to have any script that needs…to change the motion or movement of the player…looking at the InputState to determine…what the actual physical state of the player is.…
In this class, we're going to keep track…of the absolute x and y values…of the velocity of the player.…We're going to note when the player is standing.…We're also going to keep track of…when any type of input has taken place,…in this case, whatever button makes our player jump.…So let's start adding these properties to the class.…We'll make a public boolean to represent the action button.…
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.