Skip to content

Commit 060a9ef

Browse files
vincentpierreawjuliani
authored andcommitted
[Removed log what lookDir is 0 in Bouncer] (#861)
Also made the look code into Update
1 parent cff4ad4 commit 060a9ef

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

unity-environment/Assets/ML-Agents/Examples/Bouncer/Scripts/BouncerAgent.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,15 @@ private void FixedUpdate()
9898
Done();
9999
}
100100

101-
bodyObject.transform.rotation = Quaternion.Lerp(bodyObject.transform.rotation, Quaternion.LookRotation(lookDir),
102-
Time.fixedDeltaTime * 10f);
101+
}
103102

103+
private void Update()
104+
{
105+
if (lookDir.magnitude > float.Epsilon)
106+
{
107+
bodyObject.transform.rotation = Quaternion.Lerp(bodyObject.transform.rotation,
108+
Quaternion.LookRotation(lookDir),
109+
Time.deltaTime * 10f);
110+
}
104111
}
105112
}

0 commit comments

Comments
 (0)