private void ClearHitInfos()
        {
            var script = _controller.GetComponent <PlayerScript>();

            if (script != null)
            {
                script.Reset();
            }
        }
Example #2
0
        IEnumerator Start()
        {
            mController = GetComponent<CharacterController>();
            mController.stepOffset = 0;

            mTransform = transform;
            // setup physics to ignore CharacterController vs. Head collision
            var headCollider = GetComponentInChildren<CapsuleCollider>();
            Physics.IgnoreCollision(headCollider, mController.GetComponent<Collider>());

            if (Spline)
            {
                while (!Spline.IsInitialized)
                    yield return new WaitForEndOfFrame();

                Init();
            }
        }