Adding the final touches

Now we need to connect all the pieces together in to make the demo work. We to attach the SphereAgent script to the sphere, the SphereAcademy script to the Academy object and, of course, attach the Brain to the agent:

  1. We need to connect the Brain object to the SphereAgent component, as shown in the following screenshot:
  1. Set Decision Frequency to 5 and drag the cube object into the Target field.

Get Unity Artificial Intelligence Programming - Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.