Ejemplo n.º 1
0
        void Update()
        {
            Vector3 offset = transform.right * RAY_CAST_OFFSET - transform.forward * RAY_CAST_OFFSET;

            if (castRay(Vector3.zero, transform.forward) ||
                castRay(offset, transform.forward) ||
                castRay(-offset, transform.forward))
            {
                controller.slowRotation(slowRotationSpeed);
            }
            else
            {
                controller.resetRotation();
            }
        }