Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

How do you change directions depending on choices with NavMesh?

Discussion in 'Scripting' started by UndeadMadison, Apr 28, 2020.

  1. UndeadMadison

    UndeadMadison

    Joined:
    Apr 16, 2020
    Posts:
    15
    Hello! I am still kind of new to coding in C# and using Unity. I have been following this tutorial on youtube by Jimmy Vegas to at least get me somewhere on learning how to do things. I decided to go on my own and try stuff, my game is a Pet Store Simulator and I want the NPC to use NavMesh to be able to move but I also want the NPC to change routes depending on the choices the player makes. For example the NPC asks the player if they have a specific type of dog, the player clicks no so the NPC walks to the doorway. If the player says yes then the NPC goes to the front and leaves when the dog is given to them. I messed around with the code I learned from Jimmy but couldn't do anything with it to make it work how I wanted it. I hoped I could use bools to do it but it didn't work either.

    If anyone can help me I would appreciate it, thank you!
     
  2. ponef

    ponef

    Joined:
    Apr 28, 2020
    Posts:
    2
    Last edited: May 1, 2020
  3. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,735
  4. UndeadMadison

    UndeadMadison

    Joined:
    Apr 16, 2020
    Posts:
    15
  5. jayarambro4

    jayarambro4

    Joined:
    Sep 12, 2019
    Posts:
    1
  6. dudleypadberg

    dudleypadberg

    Joined:
    Mar 2, 2021
    Posts:
    1