Game Development Reference
In-Depth Information
Tip
The waypoint script will not work properly if we put the waypoint where the enemy can't
walk through, which means that our enemy should be able to walk through and touch each
waypoint (hit the green wire sphere area of each waypoint, as shown in the preceding
screenshot). Otherwise, the enemy won't be able to move to the next waypoint.
We can also adjust the radius (you will see the green wire sphere change its size) in the
waypoint radius, which will make our enemy start turning to the next waypoint faster or
slower. However, we should be careful when adjusting the radius. If we set it too low, the
character might not hit it and not turn to the next waypoint. That's why we have set the
minimum radius equal to 1.0 and maximum equal to 3.0 in the OnInspectorGUI()
function at the line EditorGUILayout.Slider(sep_radius, 1.0f, 3.0f,
"Way Point Radius"); .
In the next step, we will continue by creating the AI script to make our enemy walk
through each waypoint.
Search WWH ::




Custom Search