using System.Collections; using System.Collections.Generic; using UnityEngine; public enum WaypointType { slalom1, slalom2, finish}; public class SlalomPassed : MonoBehaviour { public WaypointType type; // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { } private void OnTriggerEnter(Collider other) { if (other.CompareTag("bike")) { // Set finished in statistics, so success is logged var bikePlayer = GameObject.Find("bike"); var playerStats = bikePlayer.GetComponent(); Debug.Log("Waypoint passed"); playerStats.SetWaypointPassed(type); } } }