I’m attempting to make a top-down racing game, but when my Player crosses the finish line it’s calling collision twice henceforth adding 2 laps
private void OnCollisionEnter2D(Collision2D collision)
{
if (collision.gameObject.layer == 12)
{
Debug.Log("col enter " + gameObject);
lapCounter.AddToLapCount();
}
}
I found out through the debug log that when I don’t turn while going through the finish it gets called once. When I do turn it gets called twice.