Files
GameDevTVObstacleDodge/Assets/Scripts/Scorer.cs

15 lines
304 B
C#
Raw Normal View History

2026-01-08 16:50:20 +00:00
using UnityEngine;
public class Scorer : MonoBehaviour
{
int hits = 0;
private void OnCollisionEnter(Collision other)
{
if (other.gameObject.tag != "Hit")
{
hits++;
Debug.Log("You've bumped into something this many times: " + hits);
}
}
}