Hi
I have a checkpoint system and at the end i made a empty game object with a box collider.
When the player enters it, it should show the position he finished.
The problem is when entering the collision area , it counts fast twice (you can even see the number changing from 1 to 2 , 3 to 4 etc)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class WayPointFinishLine : MonoBehaviour {
private int PositionNr = 0;
public TextMesh TextM;
void OnTriggerEnter(Collider other) {
PositionNr += 1;
if (other.gameObject.tag == "Player" || other.gameObject.tag == "Player2") {
TextM.text = "Finished '" + PositionNr + "'";
}
}
}