Back to Browse

Unity ML-Agents: Using the Ray Perception Sensor

646 views
Apr 10, 2026
16:09

In this tutorial, I show you how to add a 'Ray Perception Sensor 3D' to your ML-Agents project in Unity. Building on the 'Turtle Agent' project from my "Get Started with ML-Agents" series, we replace the goal position observations with a Ray Perception Sensor, configure its settings, and run a new training session. 📀 Get the completed Unity Project from here: https://www.patreon.com/posts/project-source-155239695 📜 To run a training session, use these commands: https://github.com/LudicWorlds/ml-agents-course-assets/blob/main/turtle-training-commands.md → Next Video • Coming Soon! ← Previous Video • Get Started with ML-Agents in Unity - Part 6: Inference & Training Stats: https://youtu.be/h0LW-piCLCM 🎓 Get Started with ML-Agents in Unity: https://www.youtube.com/playlist?list=PLWcLPdrF6kOnovZnG7VT86ffqdpOUcIUV 💬 Join our Discord community (free!): https://discord.gg/E3TKMv4tfV ▬ Support My Work ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ ❤️ Support me on Patreon: https://www.patreon.com/ludicworlds ☕ Buy me a coffee: https://ko-fi.com/ludicworlds Thank you for your support! ▬ Timestamps ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ 0:00 - Intro 1:14 - Adding the Ray Perception Sensor 2:14 - What is a Ray Perception Sensor? 2:57 - Why use a child GameObject? 4:16 - Configuring Detectable Tags 4:45 - How ray observations work 6:24 - Updating the TurtleAgent script 7:15 - Updating Behavior Parameters 8:20 - Sensor settings 11:45 - Training the agent 12:55 - Importing the trained model 13:30 - Testing in inference mode 14:30 - Comparing training results 15:47 - Outro ▬ Useful Links ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ ► ML-Agents GitHub Repo: https://github.com/unity-technologies/ml-agents ► ML-Agents documention: https://docs.unity3d.com/Packages/[email protected]/manual/index.html ► ML-Agents docs - RayPerceptionSensor: https://docs.unity3d.com/Packages/[email protected]/api/Unity.MLAgents.Sensors.RayPerceptionSensor.html ▬ Credits ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ ► Music by - CO.AG Music: https://www.youtube.com/@co.agmusic #unity #ai #mlagents #reinforcementlearning

Download

0 formats

No download links available.

Unity ML-Agents: Using the Ray Perception Sensor | NatokHD