User:SPARTROY

> Foreground/Platform

 * 2D Box Collider

> Player

 * 2D Box Collider
 * 2D Rigid Body

- Fixed-platform

 * 2D Rigid body (Change to Kinematic)
 * 2D Box Collider

- Rotating-platform

 * 2D Rigid body


 * 2D Box Collider
 * 2D Hinge Joint
 * Connect the fixed with the rotating
 * use motor (100,-100)
 * use limits

>Explosion


 * Edge Collider 2D

Animator
//Remove exit time

Checkpoints
Create 3 Empty game objects


 * Checkpoint (Add a empty game object at the flag)
 *  Script 

public void OnTriggerEnter2D(Collider2D other)

{

if (other.name =="Sonic_0"/*name of the character sprite*/)

{

FindObjectOfType.CurrentCheckpoint = this.gameObject;

}

}


 * LevelManager
 *  Script 
 * Add these variables
 * public GameObject CurrentCheckpoint;
 * public Transform player;

public void RespawnPlayer

{

FindObjectOfType.transform.position = CurrentCheckpoint.transform.position;

}


 * Spike
 *  Script 

public void OnTriggerEnter2D(Collider2D other)

{

if (other.name == "Sonic_0"/*name of the character sprite*/)

{

FindObjectOfType.RespawnPlayer;

}

}


 * 2D Box Collider(Tick is Triggered )

//movement
public float player_speed;

public float jump_height;

//controlling keys
public KeyCode Jump;

public KeyCode Left;

public KeyCode Right;

//Utilities
public Transform groundCheck;

public float GND_Radius;

public LayerMask WhatisGND;

public bool grounded;

//Moving Right
if (Input.GetKey(Right))

{

GetComponent.velocity = new Vector2(-player_speed, GetComponent.velocity.y);

if (GetComponent != null)

{

GetComponent.flipX = true;

}

}

//Moving Left
if (Input.GetKey(Left))

{

GetComponent.velocity = new Vector2(player_speed, GetComponent.velocity.y);

if (GetComponent != null)

{

GetComponent.flipX = false;

}

}

}

//Jump
void Jump

{

GetComponent.velocity = new Vector2(GetComponent.velocity.x, jump_height);

}

void FixedUpdate

{

grounded = Physics2D.OverlapCircle(groundCheck.position, GND_Radius, WhatisGND);

}

//For Animation
anime.SetFloat("Speed", Mathf.Abs(GetComponent.velocity.x));

anime.SetBool("Grounded", grounded); --