cube2跟踪cube1的y角度
float y = cube1.transform.eulerAngles.y;
float y2 = cube2.transform.eulerAngles.y;
float angle = Mathf.LerpAngle(y2, y, Time.deltaTime);
cube2.transform.rotation = Quaternion.Euler(0, angle, 0);
cube2跟踪cube1的y角度
float y = cube1.transform.eulerAngles.y;
float y2 = cube2.transform.eulerAngles.y;
float angle = Mathf.LerpAngle(y2, y, Time.deltaTime);
cube2.transform.rotation = Quaternion.Euler(0, angle, 0);