Do not understand how to use the Ray Perception Sensor 2D component in MLAgents

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);

1 Answer

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.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like