Create your own AI movement logic
When the character brain is set to AI, the actions stop being updated by the input handler (input devices). Now these actions need to be defined by code. This is what AI is all about, simulating a machine "pressing buttons".
In order to set up an AI character from zero you need to:
Change the brain mode to "AI" in the CharacterBrain component.
Add an CharacterAIBehaviour component to the character (wherever you want).
Assign the CharacterAIBehaviour to the CharacterBrain.
Human and AI move around using the same components, there is no need to add a NavMeshAgent or something similar. Also you don't need a NavMesh for this to work, although you can use one if you want (see the AI Follow behaviour).
The AI behaviour
The brain will use the character actions from the current AI behaviour. Basically this behaviour task is to define this action frame by frame, as simple as that.
To create an AI behaviour you need to derive your class from CharacterAIBehaviour.
From there you can create your own custom logic. For instance, to simulate the AI running forward:
You can check the character actions preview from the CharacterBrain inspector.
Last updated