The AIController routes are responsible for a large part of how and where you see the enemy in-game.
While we label the positions the enemies move between as “teleport points”, they do not actually teleport at all, but rather each teleport point has a model of the enemy that is turned on or off. This method has several benefits:
- It’s easier to position and visualize the enemy in the editor
- The enemy can be posed at each point any way you want, without having to configure complex animators or arrays of models.
- The lighting on the enemy can be baked in at each point, improving the look and performance of the game.
However, the drawback of this is that characters can not share routes, requiring a bit more setup in the editor.
If you expand the AIController in the hierarchy, there is a GameObject for each enemy in the level. Under each of those are the routes that are set up for that character. If you select the route, you will see the following options in the inspector:
Teleport Points: This is simply an ordered list of teleport points that this Route can use. Element 0 is considered the start of the route. You can have as many teleport points on a route as you would like. You can also share teleport points between routes, as long as both routes belong to the same character. More information on Teleport Points below
Forwards Range: This is how far the enemy can move when moving forwards along the route (assuming they are set to “Teleport In Sequence”)
Backwards Range: How far the enemy can move backwards.
Forward Move Weight: This is the percentage chance that the enemy will move forward when selecting a new teleport point. You will usually want this at least higher than 50, otherwise the enemy may never reach any attack spots.
We’ve broken down the individual pages in the AI Controller settings category for each part.
Browse this link for more game AI settings from the AI Controller documentation.