- Home /
Question by
dudemeister03 · Apr 15, 2020 at 08:38 PM ·
death
my player hits the death floor then wont move this is 2D
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class deathcode : MonoBehaviour
{
void OnCollisionEnter2D(Collision2D col)
{
if(col.transform.CompareTag("player"))
{
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
}
}
}
Comment
Answer by dudemeister03 · Apr 15, 2020 at 08:50 PM
https://youtu.be/0yisq_RRyj8 this is a video of what happens in unity (please ignore the 0 on the play area I'm still making the script for the score and haven't set it to the text yet)
Your answer
Follow this Question
Related Questions
Simultaneous Hits 1 Answer
Fall Death 1 Answer
Player Health and Death 1 Answer
kill counter 1 Answer
What's the best workaround for disabled colliders not firing OnTriggerExit events? 2 Answers