Join Jesse Freeman for an in-depth discussion in this video Moving up, part of Unity 4: 2D Essential Training.
…So now that our player can move left and…right, let's add in the logic to use the jetpack.…We'll go back into our player script and…we're going to add two variables here in order to…track, one, whether the player is standing, and…two, what the jet speed actually is going to be.…Here you'll see we'll create the variable standing, which…is a Boolean and by default, it's going to be false.…And now we can create the jetSpeed variable.…This is going to be a float, and we're going to set this to 15.…
Now, before we move on, we're going to need to get the absolute value…of the y velocity just like we did with the x, so let's copy…this entire line of code and paste it below, making sure to change…this absolute velocity to Y and the rigid body velocity to y as well.…Also below it we're going to want to make…sure that we know when the player is standing.…Here, we'll test that the absolute value of y is less than 0.2.…Now, we can tell that if the velocity is less than 2, the player is standing.…
If it is not, we'll copy this variable over and reset it to false.…
- Installing Unity
- Creating a new project
- Making scripts in Unity with C#
- Working with 2D artwork
- Creating animations
- Creating and moving players
- Adding collisions
- Creating an alien enemy
- Extending Unity with gizmos
- Creating a simple tile map
- Switching between levels
- Publishing your game
Skill Level Intermediate
Unity 3D: 3.5 Essential Trainingwith Sue Blackman10h 52m Beginner
Animating for Unity 3D in 3ds Maxwith Adam Crespi1h 19m Intermediate
1. Getting Started with Unity
2. Working with Sprites
3. Creating a Player
4. Interactive Objects
5. Aliens and AI
6. Making a Level
7. Working with Sound
8. Managing Scenes
9. Publishing Basics
Publishing overview3m 36s
Next steps1m 9s
- 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.