Search Unity

Issues creating a simple AI

Discussion in 'Navigation' started by Light1c3, Feb 3, 2015.

  1. Light1c3

    Light1c3

    Joined:
    Jan 26, 2015
    Posts:
    2
    I created this game with a few friends for the Global Game Jam, but sadly none of us really had any experiance with the new Unity so the game didn't really make it to where we wanted it to.

    We are now trying to finish it, but I am unable to create an AI :(

    It's a top down game, where the enemys have flashlights the I am trying to use as a trigger for when they spot the player but I can even create a navmesh let alone get them to react to things.

    Help would be appreciated!
     
  2. Jmanpie

    Jmanpie

    Joined:
    Oct 7, 2012
    Posts:
    132
    Unity has navmesh tutorials:




    Create a Finite state machine to handle the lodgic and animations (most modern games use trees now but finite state machines are good stepping stone).
    this is pretty good for FSM:


    too detect the player use a collier maybe a cone or something and when the player enters make the enemy shoot a raycast directly ahead of its self and if it hit the player it can see it.