In this example, we are going to do some simple implementations of the enemy AI, where auto-follow and animations are the focus, and we want to achieve the following goals:
1. The enemy can automatically follow the protagonist
2. Enemy Model A total of four actions: idle (idle) run (run) Attack (attack) Death (death).
3. Ask the enemy to make the right moves at the right time
(i) Implementation of automatic follow-up
1) First, create a new scene with at least two characters in the scene: there is an enemy (blade skeleton) and a protagonist (yes, that's the capsule)
2) First select the scene model, and then in the Inspector window option Static next to the small triangle display drop-down menu, to determine where Navigation Static is selected. For model options unrelated to the scene terrain, make sure that it is not selected.
The options for the Navigation window are primarily to define the impact of the terrain on the seek path. Radius and height can be understood as the radius and altitude of the seeker. Max Slope is the maximum slope, which is beyond the path of the slope seeker. Step height is the maximum height of the staircase, which is beyond the height of the road seeker. The drop height indicates the height limit at which the seeker can jump. The jump Distance represents the jumping distance limit of the seeker. ---to be continued---
Unity3d An example of an enemy AI and animation (Animator) system