0

So i started to learn the MLAgents Package. I wanted to make a little 2D Space game with an AI which detects the environment (Player, other AIs, Asteroids etc.) through Rays.

I figured out that you can add a Ray Perception Sensor 2D Component to your agent. I understand how it works, but i cannot find anything on how to USE it with your code.

I just want to let the agent fly around and give it a Reward and shoot at it´s Target when it finds something with the Ray. Like => if (ray.tag == target) then shoot() and Reward(+1);

preuschhi
  • 1
  • 1

1 Answers1

0

Unity's introduction tutorial to ml-agents, ml-agents: Hummingbirds, might be a good resource for you. In that tutorial, they make use of reycasts and integrate their functionality with ml-agents.

You can find the tutorial at Unity learn - ML-Agents: Hummingbirds.

Marcus
  • 401
  • 6
  • 13