O'Reilly logo

Learn Unity ML-Agents - Fundamentals of Unity Machine Learning by Micheal Lanham

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Herbivores to the rescue

The herbivore will be our most basic agent that will learn to live in the terrarium. A herbivore creature will thrive by consuming plants, which will give them energy to grow and reproduce. We can follow several of the same basic patterns we used building the Plant script when creating our Herbivore agent script. Open up Unity and follow this exercise to code the Herbivore agent script:

  1. Create a new script called CreatureAgent in the Assets/Terrarium/Scripts folder and open it in your editor of choice. Fortunately, we won't need to create a different script for each different type of agent if we generalize things into a single CreatureAgent script.
  2. We will cover each section of this script as we build it. Enter the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required