Group Group Group Group Group Group Group Group Group

raywenderlich.com Forums

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

Learn how to create a game like Jetpack Joyride in Unity 2D in this three part tutorial series.


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

Great tutorial!
Just one little update for Unity 5 users in regards to sorting the particle system. No need for a coding script to sort the layer. Go to your particle’s Inspector, expand “Renderer” and you should see the fields “Sorting Layer” and “Order in Layer” (close to the bottom). Select the sorting layer that you wish the particles to appear on. Ta Da! Your particles are sorted. Hope that helps someone. : )

Great tutorial! thanks alot!

Wow man its the awsome tutorial due to this i have learnt the basic usage and working of physcis engine and their role in different objects also the unity itself now i know from where to start plzzzz plzzz plzz @Kirill also publish other unity tutorial for different game types like shooting and racing

Hi I am Using Unity 5.5 and Rigidbody2D does not have a method AddForce.
I get this error when I compile:

Type Unity.Engine component does not contain a definition of AddForce and no extension method AddForce.

Never mind after learning more about the Rid

After learning more about the Rigidbody2D I added the following and it works fine.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MouseController : MonoBehaviour {

public float jetpackForce = 75.0f;

private Rigidbody2D rb2d;

void Start () {
	rb2d = GetComponent<Rigidbody2D>();
}

void Update () {
	
}

void FixedUpdate () 
{
	bool jetpackActive = Input.GetButton("Fire1");

	if (jetpackActive)
	{
		rb2d.AddForce(new Vector2(0, jetpackForce));
	}
}

}

Regarding the mouse ,the Enable the Fixed Angle checkbox inside the Rigidbody 2D component is not supported, under Constrains check the Z box of the Freeze Rotation Constrains.

Fixing the Particle System Sorting Order for Unit 5 and up users.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ParticleSortingLayerFix : MonoBehaviour {
private ParticleSystemRenderer psr;

void Start () {
	psr = GetComponent<ParticleSystemRenderer> ();
	psr.sortingLayerName="Player";
	psr.sortingOrder = -1;
}


void Update () {
	
}

}

Fantastic tutorial. Excellent style and approach. Thanks!

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! :]