Join Jesse Freeman for an in-depth discussion in this video Moving obstacles, part of Unity 5: 2D Essential Training (2015).
- So now we're ready to actually make our object move.…A few things we'll have to set up before that…is let's make sure that our obstacle has a box collider.…Here we'll filter our for a box collider 2D.…By adding the box collider,…we'll allow this object to interact…with other objects with colliders on them,…like the player which we'll add later on.…Now let's create a script to make…this move across the screen.…Inside of our script folder, let's create…a new C# Script.…
And we're gonna call this Instant Velocity.…Then let's open this in Model Develop.…We'll start out by setting up a property…to store the velocity we want this object to have.…We'll make this a vector, too, and call it Velocity.…And let's instantiate it as a Vector2…that's been zeroed out.…Next, we'll need a reference to the rigid body itself.…Let's create a property to store the rigid body.…We'll type it's a Rigidbody2D and call it body2d.…Next we'll need to get a reference to the actual rigid body.…
We'll do this in an awake method.…Let's create a void as the return.…
Super Zombie Runner riffs off the popular endless runner genre: a one-button casual game that's not only fun to play but exciting to build. The focus of the work is a reusable code base that you can extend and make your own, while learning the basics of object pooling, supporting multiple screen resolutions, tracking scoring, and multi-platform publishing. Along the way, Jesse covers key Unity features, such as working with sprites, creating animations, and leveraging the UI components.
- Working with sprites and animation
- Creating the player
- Spawning GameObjects
- Adding obstacles and collisions
- Building the game objects and logic
- Managing game state
- Creating pixel-perfect cameras
- Designing for multiple screen resolutions
- Adding scores
- Optimizing performance
- Publishing to desktop, web, and mobile platforms
Skill Level Intermediate
1. Working with Sprites
2. Creating Repeating Textures
3. Creating Obstacles
4. Object Pooling
5. Creating the Player
6. Setting Up the Game
7. Adding UI
8. Creating More Obstacles
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
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.