diff --git a/unity-environment/Assets/ML-Agents/Examples/3DBall/Scripts/Ball3DDecision.cs b/unity-environment/Assets/ML-Agents/Examples/3DBall/Scripts/Ball3DDecision.cs index 3700c21352..ac1faa5966 100755 --- a/unity-environment/Assets/ML-Agents/Examples/3DBall/Scripts/Ball3DDecision.cs +++ b/unity-environment/Assets/ML-Agents/Examples/3DBall/Scripts/Ball3DDecision.cs @@ -8,7 +8,24 @@ public float[] Decide(List state, List observation, float reward, { if (gameObject.GetComponent().brainParameters.actionSpaceType == StateType.continuous) { - return new float[4]{ 0f, 0f, 0f, 0.0f }; + List ret = new List(); + if (state[2] < 0 || state[5] < 0) + { + ret.Add(state[5]); + } + else + { + ret.Add(state[5]); + } + if (state[3] < 0 || state[7] < 0) + { + ret.Add(-state[7]); + } + else + { + ret.Add(-state[7]); + } + return ret.ToArray(); } else