How to Make a Game Like Jetpack Joyride in Unity 2D – Part 3

In the final part of this series, you will generate some coins and lasers, construct a scrolling background, all to some fancy beats. By Mark Placzek.

Leave a rating/review
Download materials
Save for later
Share
You are currently viewing page 7 of 7 of this article. Click here to view the first page.

Fixing the Order of the Cameras

Select ParallaxCamera in the Hierarchy. In the Inspector, find the Camera component and look for a Depth field. Set it to -2.

Note: The Depth of the ParallaxCamera should be lower than the Depth of the Main Camera, so check your Main Camera Depth if required and adjust the Depth of the ParallaxCamera to be lower.

However, if you run the game right now you won’t see the parallax background through the window.

To fix this, select the Main Camera in the Hierarchy and set its Clear Flags to Depth Only. This way it won't clear out the picture drawn by the parallax camera.

Run the scene. Now you will see the parallax background through the window.

You now have a fully functioning and decorated game. Great job! Thanks for sticking with it through all three parts!.

Where to Go From Here?

That mouse sure did sacrifice himself many times in the making of this tutorial series. Hopefully you enjoyed the end result though and his deaths were not in vain! If you want to compare your end result you can download the final project from the materials at the top or bottom of this tutorial.

Check out this this video if you want to know more about the making of the actual Jetpack Joyride game.

Creating a parallax background is heavily inspired by this video by Mike Geig, who has a lot of really cool videos on Unity.

Please post your questions and comments below. Thank you for following along with this tutorial! :]

Mark Placzek

Contributors

Mark Placzek

Author

Toby Flint

Tech Editor

Chris Belanger

Editor

Sean Stewart

Illustrator

Sean Duffy

Final Pass Editor

Over 300 content creators. Join our team.