/// <summary> /// Initializes the path movement. /// </summary> private void Start() { body = GetComponent <Rigidbody>(); startProgress = pathProgress; if (startPath != null) { ResetPosition(); } UpdateGroundOffset(); sideOffset = GetComponent <Collider>().bounds.extents.z; transform.eulerAngles = Vector3.up * Vector3.Angle(Vector3.right, currentPath.GetDirection(true)); rotates = GetComponent <Rotate>() != null; FacePath(true); }