Vector3.ProjectOnPlane() is a method in Unity's Vector3 class that projects a vector onto a plane that is defined by a normal vector.
Vector3.ProjectOnPlane(Vector3 vector, Vector3 planeNormal)
vector: The original vector that you want to project.planeNormal: The normal of the plane onto which the vector will be projected.RotateTowards() Have a Zeno's Paradox Issue?No, Quaternion.RotateTowards() does not suffer from Zeno's Paradox. Unlike Lerp(), which takes a fraction of the remaining distance each frame, RotateTowards() moves at a fixed speed (e.g., 45° per second), ensuring it reaches the target in finite time.
Lerp() Have a Zeno-Like Issue?Lerp() uses a fractional interpolation:
transform.rotation = Quaternion.Lerp(transform.rotation, targetRotation, lerpSpeed * Time.deltaTime);
Lerp() moves by a fraction of the remaining distance, it slows down as it gets closer.lerpSpeed * Time.deltaTime is small, it may never exactly reach the target due to floating-point precision.RotateTowards() Work?transform.rotation = Quaternion.RotateTowards(transform.rotation, targetRotation, rotationSpeed * Time.deltaTime);
rotationSpeed * Time.deltaTime, RotateTowards() snaps to the final rotation.If you must use Lerp() but want to ensure the rotation completes in exactly 2 seconds, manually interpolate based on elapsed time:
float rotationTime = 2f; // Time to complete rotation
float elapsedTime = 0f;
Quaternion startRotation;
Quaternion targetRotation;
void Start()
{
startRotation = transform.rotation;
targetRotation = Quaternion.Euler(0, 90, 0);
}
void Update()
{
if (elapsedTime < rotationTime)
{
elapsedTime += Time.deltaTime;
float t = elapsedTime / rotationTime; // Normalize time (0 to 1)
transform.rotation = Quaternion.Lerp(startRotation, targetRotation, t);
}
else
{
transform.rotation = targetRotation; // Ensure it snaps to the final rotation
}
}

기하학적으로 다시 풀기. 각도 오프셋만큼 되돌린 후에, 길이를 정사영해주면 됨
문제
해결 과정

[SerializeField][Range(0, 1f)] private float length_magic_number_subt;
Vector2 c = new Vector2(x_c - length_magic_number_subt, y_c);
정사영은 포기하고 매직 넘버 빼서 해결했다.
문제 발생 원인은 모르겠지만, 더 이상 시간 지체 불가.
if (EventSystem.current.IsPointerOverGameObject()) return; void Update()
{
if (target_to_reach == null) return;
Rotate_To_Goal_Continously();
}
private void Rotate_To_Goal_Continously()
{
// y_axis_part.localRotation = Quaternion.RotateTowards(y_axis_part.rotation, y_axis_part_rotation_goal, move_time * Time.deltaTime);
x_axis_part.localRotation = Quaternion.RotateTowards(x_axis_part.localRotation, x_axis_part_rotation_goal, move_time);
x_axis_part_2.localRotation = Quaternion.RotateTowards(x_axis_part_2.localRotation, x_axis_part_2_rotation_goal, move_time);
hand_part.localRotation = Quaternion.RotateTowards(hand_part.localRotation, hand_part_rotation_goal, move_time);
}
public void SetTarget(Transform target, float time)
{
target_to_reach = target;
move_time = time;
Set_Angle_Offset();
Set_Y_Rotation();
Set_X_Axis_Angles();
}
private void Set_Angle_Offset()
{
Vector3 a = tongs_part.position - x_axis_part.position;
Vector3 b = hand_part.position - x_axis_part.position;
a.y = 0;
b.y = 0;
hand_angle_offset = Vector3.Angle(a, b);
}
섹션 1.12


(뭐 때문인지 모르겠는데 오류 나서 이상하게 보임. flare도 lens flare 추가해야 보인다)