We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3ba6bc7 commit 32b84a5Copy full SHA for 32b84a5
Assets/Scripts/Drive.cs
@@ -33,9 +33,11 @@ void Update()
33
34
void Translate(Transform transform, Vector3 dir)
35
{
36
- float angleYAxis = UMath.Angle(Vector3.up, transform.up);
+ if(Vector3.Distance(Vector3.zero, dir) == 0) return;
37
+
38
+ float angleYAxis = UMath.Angle(dir, transform.up);
39
- if (UMath.IsDirectionClockWise(Vector3.up, transform.up))
40
+ if (UMath.IsDirectionClockWise(dir, transform.up))
41
42
angleYAxis = 2 * Mathf.PI - angleYAxis;
43
}
0 commit comments