Beetles in our game will search for cucumbers within the sandbox area. In this section, we will write a script to manage their patrol. Let's take some preparatory steps.
We will get started by creating a character controller for our Beetle prefab. Here are the steps:
- In the Project panel, select Assets | Prefabs and click on the Beetle prefab
- In the Inspector panel, click the Add Component button
- Select Physics | Character Controller
We do not need to make any changes to the default character controller, but we do need to have one.
Next, let's make things easy on us and create some temporary containing walls for the ...