Simple Run Game 2d Death
I make a Simple game, a endless run 2d and i want to know if how can i do some simple death. Like when my character falls into the platform the character will fall into the boxCollider2d that i named Death. Please help me guys :( i really want to know a lot. This is the first time that i ask in here. so i dont know how y'all gonna reply me but please answer me, im begging. Thanks a lot.
Answer by VeeooshL · Apr 03, 2017 at 09:24 PM
Here, this should work:
using UnityEngine;
using System.Collections;
public class DeathZone : MonoBehaviour {
void OnTriggerEnter2D(Collider2D other) {
Application.LoadLevel(0);
}
}
The script should be called DeathZone, and be placed on your death plane. Make sure that the checkbox 'trigger' is checked on the Collider 2D that is on your death plane.
Thanks dude. Thank you so much. Thank you!!! thanks thanks thanks. THanks.
Your answer
Follow this Question
Related Questions
[HELP] Player passes through red tiles even though it shouldn't 1 Answer
How to kill enemy when the bullet hits the BoxColllider2D? 1 Answer
how avoided this among my player and the wall? 0 Answers
BoxCollider2D animation sometimes does not match the frame that corresponds to it 0 Answers
Get all the coordinates inside of a Collider Unity 2D 1 Answer