I’m following this tutorial for a score system but it seems that the edge collider with the Is Trigger box checked isn’t working. Any idea why?
Here is my script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Scoring : MonoBehaviour
{
public int Score;
public Text ScoreText;
private void OnTriggertEnter2D(Collider2D other)
{
Destroy(other.gameObject);
AddScore();
Debug.Log("im triggered lol");
}
void AddScore()
{
Score++;
ScoreText.text = Score.ToString();
}
}
My trigger looks like this: