final feedbacks fixed

This commit is contained in:
2026-04-20 14:36:51 +05:30
parent 4ba7623b13
commit f31f90034c
9 changed files with 570 additions and 1989 deletions
+13
View File
@@ -166,9 +166,22 @@ public class Puck : NetworkBehaviour
Debug.Log("Resetting puck", gameObject);
Vector3 dir = position - transform.position;
Vector3 centerDir = Vector3.zero - transform.position;
dir = dir.normalized;
centerDir = centerDir.normalized;
// Clamp direction to within 30 degrees of centerDir if needed
float maxAngle = 30f;
float angle = Vector3.Angle(dir, centerDir);
if (angle > maxAngle)
{
dir = Vector3.Slerp(centerDir, dir, maxAngle / angle).normalized;
}
position += dir * 1.25f;
Reset(position, duration);
}
IEnumerator CoroutineReset(Vector3 pos, float duration){