Updating an agents' destinations

Now that we have set up our AI agent, we need a way to tell this agent where to go and update the destination of the tanks to the mouse click position.

So, let's add a sphere entity, which is going to be used as a marker object, and then attach the Target.cs script to an empty game object. Drag and drop this sphere entity onto this script's targetMarker transform property in the inspector.

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.