top of page
Search

[16/03/2021] Adding Car AI

  • Writer: Daniel Henshaw
    Daniel Henshaw
  • Mar 15, 2021
  • 1 min read

Updated: May 19, 2021

I created Car AI using the same script as the Player is managed by. This makes it so I can use the same functions and movement methods as the player. By doing this it made it so players and AI driving were identical.


To do this I created a boolean called "isPlayer" which when set to true allows the car to be controlled by the player and when set to false the car will be controlled by AI. This also makes it so that if during the game the bool "isPlayer" is set from true to false AI will take over.


I used empty game objects as nodes to build a path around the level which is used for the AI to get directions to navigate the track.


Demo:


Path:


 
 
 

Comments


bottom of page