Kodeco Forums

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

In the second part of a three part series, you will be generating a series of endless rooms, allowing the user to fly through them.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/2341-how-to-make-a-game-like-jetpack-joyride-in-unity-2d-part-2

Hi Im using Unity 5.3.5f1 and after completing the 2nd part Im unable to turn the flames off for the jetpack when the mouse is grounded I had to update the AdjustJetpack function code to use with Unity 5.3.5f1 as soe of your code was deprecated. I was suggested the code from the forum but its not turning the particles off when the mouse is on the ground nor is it slowing it down while landing…

I think this will do the trick:

void AdjustJetpack(bool jetpackActive)
{
var em = jetpack.emission;
em.enabled = !grounded;
em.rate = jetpackActive ? 300.0f : 75.0f;
}

This tutorial is more than six months old so questions are no longer supported at the moment for it. We will update it as soon as possible. Thank you! :]