generate Input.GetKeyDown("space") event from agent.

Hi ,

Lets say I have a existing game in which I use GetKeyDown("space") for character Jump , Now with agent action I want to control the Jump without disturbing the original code i.e agent should generate "space" presses instead of human.

How do I pass actions from my agents to unity input system without or with minimal modification to original code ? this will enable to easily create a agent without disturbing the original game.

Thanks.

Hello,

It is currently not possible to add ML-Agents to a game that uses the input system without some amount of code changes. It isn't possible for the agent to generate a virtual key press. I would recommend taking a look at the Heurstic function, and see whether you can put the space check in there. That may allow you to use an ML-Agents agent under the hood for your behavior. https://github.com/Unity-Technologies/ml-agents/blob/8ad72c08d7d9408c4dda4601beec7f8e82f911ed/docs/Learning-Environment-Create-New.md#testing-the-environment

Thanks you , I will look into it.