"How to set up AI tank" (Ver.1.1)

Please feel free to contact me if you have any questions.
shopmaster@chobi-glass.com
http://chobi-glass.com/Unity/index.html


This tutorial shows how to attach AI components to the tank.
This tutorial uses a new tank made in the previous tutorials "How to make a new tank" and "How to make a Track Belt".


(1) Attach AI components to the tank.
    You can find the prefab "AI_Core" in the "Tank_Components" folder under the "Prefabs" folder.
    Drag and drop it into the "MainBody" of the tank in the Hierarchy window.
    And make sure that the "AI_Core" is placed under the "MainBody" as the child.
   


(2) Adjust the position of the "AI_Eye".
    Select the "AI_Eye" placed under the "AI_Core" in the hierarchy.
    And move the position to a little above the turret. The AI casts a ray from this object to detect the target.
   
    (Note.)
    The position of this object is very important for detecting the target.
    When this position is too low, the AI cannot detect any target because the searching ray has been obstructed by its collider.



(3) Adjust the position and the size of the "AI_Hand".
    Select the "AI_Hand" placed under the "AI_Core" in the hierarchy.
    You can see the "AI_Hand" as a translucent box in front of the tank. This object is used for detecting an obstacle in front of the tank.
   
Adjust the position and the scale so that the box does not touch the tank.
   


(4) Test the behavior in the runtime.
    Create a new prefab of your AI tank to use it in other scenes, and test it in the runtime.
    About the AI settings, please read the reference "Spawner" and "AI_Core".
   


Please feel free to contact me if you have any questions.
shopmaster@chobi-glass.com
http://chobi-glass.com/Unity/index.html