void OnTriggerEnter(Collider other) { Debug.Log(other.ToString()); if (other.GetComponent(typeof(SplineInterpolator))) { SplineInterpolator temp = (SplineInterpolator)other.GetComponent(typeof(SplineInterpolator)); cart = temp; temp.stopState(); if (thisObject.name == ("endTrigger")) { Debug.Log("YESSS"); //Application.LoadLevel("EndScene"); animator.SetTrigger("GameOver"); animator2.SetTrigger("GameOver"); Debug.Log("animation played"); } Invoke("continueRolling", timeStopped); } }