Search Unity

build Simple AI pacman Style

Discussion in 'Navigation' started by Sylon87, May 11, 2019.

  1. Sylon87

    Sylon87

    Joined:
    Aug 20, 2018
    Posts:
    196
    hello.

    i'm trying to buld a simple AI for an simil Pacman game, that would be in 3D, where when you are not looking to the enemy they will come to try to eat you, but if you are facing to the and you are close maybe 1 meter they will run away.

    so what i need is
    - get like a cone from the enmy to one meter, that will check if Player coming
    - eat collectable object.
    - run away when player is coming
    - go to eat player if he isen't facing to NPC.

    right now i was able just make it able to run away when player is too closest to the NPC, but i'm totally wondering to how do the other things.

    anyone have some tutorial or resources where i can learn it?

    any help will be appreciated.

    thank's in advance
     
  2. Yandalf

    Yandalf

    Joined:
    Feb 11, 2014
    Posts:
    491
    To get your enemies chasing the player just set their destination to the player's position, and update this periodically (say every second).
    Your other issues are not related to this subforum, this one is strictly related to using the navigation systems.
    However, they seem basic enough to solve to me. You shouldn't have much trouble figuring things out.
    Don't look up your specific problems, just look for general solutions.
     
    Sylon87 likes this.