Skip to content

Commit 47c965c

Browse files
authored
In Examples, replace hardcoded value 200f by agentRotationSpeed (#6306)
1 parent a0bd0ab commit 47c965c

7 files changed

Lines changed: 9 additions & 6 deletions

File tree

Project/Assets/ML-Agents/Examples/DungeonEscape/Scenes/DungeonEscape.unity

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2798,7 +2798,7 @@ MonoBehaviour:
27982798
m_Name:
27992799
m_EditorClassIdentifier:
28002800
agentRunSpeed: 3
2801-
agentRotationSpeed: 15
2801+
agentRotationSpeed: 200
28022802
spawnAreaMarginMultiplier: 0.5
28032803
goalScoredMaterial: {fileID: 2100000, guid: df32cc593804f42df97464dc455057b8, type: 2}
28042804
failMaterial: {fileID: 2100000, guid: a1daf31cdf41e484ca9ac33a5c6f524a, type: 2}

Project/Assets/ML-Agents/Examples/DungeonEscape/Scripts/PushAgentEscape.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public void MoveAgent(ActionSegment<int> act)
6363
dirToGo = transform.right * 0.75f;
6464
break;
6565
}
66-
transform.Rotate(rotateDir, Time.fixedDeltaTime * 200f);
66+
transform.Rotate(rotateDir, Time.fixedDeltaTime * m_PushBlockSettings.agentRotationSpeed);
6767
m_AgentRb.AddForce(dirToGo * m_PushBlockSettings.agentRunSpeed,
6868
ForceMode.VelocityChange);
6969
}

Project/Assets/ML-Agents/Examples/PushBlock/Scenes/PushBlock.unity

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1900,7 +1900,7 @@ MonoBehaviour:
19001900
m_Name:
19011901
m_EditorClassIdentifier:
19021902
agentRunSpeed: 3
1903-
agentRotationSpeed: 15
1903+
agentRotationSpeed: 200
19041904
spawnAreaMarginMultiplier: 0.5
19051905
goalScoredMaterial: {fileID: 2100000, guid: df32cc593804f42df97464dc455057b8, type: 2}
19061906
failMaterial: {fileID: 2100000, guid: a1daf31cdf41e484ca9ac33a5c6f524a, type: 2}

Project/Assets/ML-Agents/Examples/PushBlock/Scenes/PushBlockCollab.unity

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ MonoBehaviour:
723723
m_Name:
724724
m_EditorClassIdentifier:
725725
agentRunSpeed: 3
726-
agentRotationSpeed: 15
726+
agentRotationSpeed: 200
727727
spawnAreaMarginMultiplier: 0.5
728728
goalScoredMaterial: {fileID: 2100000, guid: df32cc593804f42df97464dc455057b8, type: 2}
729729
failMaterial: {fileID: 2100000, guid: a1daf31cdf41e484ca9ac33a5c6f524a, type: 2}

Project/Assets/ML-Agents/Examples/PushBlock/Scripts/PushAgentBasic.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public void MoveAgent(ActionSegment<int> act)
157157
dirToGo = transform.right * 0.75f;
158158
break;
159159
}
160-
transform.Rotate(rotateDir, Time.fixedDeltaTime * 200f);
160+
transform.Rotate(rotateDir, Time.fixedDeltaTime * m_PushBlockSettings.agentRotationSpeed);
161161
m_AgentRb.AddForce(dirToGo * m_PushBlockSettings.agentRunSpeed,
162162
ForceMode.VelocityChange);
163163
}

Project/Assets/ML-Agents/Examples/PushBlock/Scripts/PushAgentCollab.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public void MoveAgent(ActionSegment<int> act)
5252
dirToGo = transform.right * 0.75f;
5353
break;
5454
}
55-
transform.Rotate(rotateDir, Time.fixedDeltaTime * 200f);
55+
transform.Rotate(rotateDir, Time.fixedDeltaTime * m_PushBlockSettings.agentRotationSpeed);
5656
m_AgentRb.AddForce(dirToGo * m_PushBlockSettings.agentRunSpeed,
5757
ForceMode.VelocityChange);
5858
}

com.unity.ml-agents/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ and this project adheres to
1616
- Fixed a bug when using LSTM and SAC where the buffer might contain non-integer numbers of sequences. (#6301)
1717
- Fixed mixed CPU/GPU computation by ensuring tensors share a consistent device in the trainer; Updated training devices. (#6303)
1818

19+
#### Examples
20+
- Replace hardcoded value 200f by agentRotationSpeed in MoveAgent() (#6306)
21+
1922
## [4.0.3] - 2026-04-17
2023
### Minor Changes
2124
#### com.unity.ml-agents (C#)

0 commit comments

Comments
 (0)