浏览代码

Fix missing action axis in Tennis (#3732)

* Fix missing action axis in Tennis

* Update Project/Assets/ML-Agents/Examples/Tennis/Scripts/TennisAgent.cs

Fix typo

Co-Authored-By: Chris Elion <chris.elion@unity3d.com>

Co-authored-by: Chris Elion <chris.elion@unity3d.com>
/develop/add-fire
GitHub 5 年前
当前提交
92870d43
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. 7
      Project/Assets/ML-Agents/Examples/Tennis/Scripts/TennisAgent.cs

7
Project/Assets/ML-Agents/Examples/Tennis/Scripts/TennisAgent.cs


public override float[] Heuristic()
{
var action = new float[2];
var action = new float[3];
action[0] = Input.GetAxis("Horizontal");
action[1] = Input.GetKey(KeyCode.Space) ? 1f : 0f;
action[0] = Input.GetAxis("Horizontal"); // Racket Movement
action[1] = Input.GetKey(KeyCode.Space) ? 1f : 0f; // Racket Jumping
action[2] = Input.GetAxis("Vertical"); // Racket Rotation
return action;
}

正在加载...
取消
保存