Game Development Reference
In-Depth Information
Mission briefing
This project will start by setting up the Waypoint script. The waypoint is basically a path
made from many points that AI will be following from the start to the end point. This script
will allow us to control the direction and area where AI can be moved. We will also create
the WaypointsContainer script and CustomEditor for it. This editor script will make
it easy for us to add/remove and control how the AI should be moved, such as randomly
moving or moving by order to each waypoint.
To make it easier for us to see each waypoint and its moving direction, we will use the
OnDrawGizmos() function, which will allow us to see the wireframe, raycast line, icons,
and the area while we are playing or editing the game in the Scene view. This is very
powerful for debugging and editing the level in the game.
Next, we will create the AI character and its script, which will be inherited from Charac-
terClass . This class is basically the class that contains all the functions and parameters
similar to the CharacterControl class that we have used in the Project 5 , Build a
Rocket Launcher! , with some additional methods. The AI script will be able to move the AI
character to each waypoint, stop, walk, jump if it hits the wall, and run and shoot if the
player is in the range.
Finally, we will add the hit-point UI bar for our character and the AI to show how much
damage is caused when the enemy attacks us or when we shoot at the enemy.
Search WWH ::




Custom Search