final feedbacks fixed
This commit is contained in:
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user