Hi! So I was trying to make a platformer game. The player was detecting collisions with a patrolling enemy just fine and was respawning every time. However, when I tried the same method, but changed the trigger, it didn’t work. I may be making a very beginner-like mistake because I am one, but I hope someone will answer me.`using Cinemachine;
using UnityEngine;
using UnityEngine.SceneManagement;
public class PlayerDeath : MonoBehaviour
{
public DeathTrigger dt;
public float minYval;
private void OnCollisionEnter2D(Collision2D collision)
{
if (collision.gameObject.CompareTag("Enemy"))
{
Destroy(gameObject);
LevelManager.instance.Respawn();
}
if (collision.gameObject.CompareTag("DeathTrigger"))
{
Destroy(gameObject);
LevelManager.instance.Respawn();
}
}
}
`