Forum rules - please read before posting.

NPCs, Paths and Obstacles

edited December 2016 in Technical Q&A
Couldnt find something simular with the search in the forum. 
I have direct control in my game. I setup a NPC with a path and the wandering is working great. 
Now i want to avoid obstacles the NPC along his path. I created a NavmeshSegment with a static obstacle and the NPC is not pathfinding the way, he goes straigth his path. 
Doesnt use the Path script pathfinding? I can remember i saw anywhere an option for "use pathfinding" or something like this. Are there any restrictions? 

Edit: Option Keep out of Players Way also not working. =(

Comments

  • maybe i have to use navmesh agent component? 
  • Are these obstacles dynamic, or baked into your NavMesh?

    Not avoiding obstacles and not sticking to the NavMesh are two separate issues - let's focus on the NavMesh issue first as it's a prerequisite to the obstacle one.

    You will need to provide full details on what you've done so far - otherwise, all I can do is direct you to the Manual's Section 2.12 and the associated tutorial.  Screenshots of your NavMesh and NPC's full Inspector in particular will help.
  • edited December 2016
    I am using a baked obstacle. 
    It is just for testing currently so i did a npc via AC wizard. Put a navmesh segment down with a obstacle. baked it with the unity navigation tab. Created a 2 node path and assigned it with a cutscene with the  action Character: Move along Path to the NPC. He ignores the obstacle and goes straight the path. Maybe i am doing something wrong but what? 

    image

    image
    image
    image
  • Here the settings: 

    image
    image
    image
  • The character isn't going to perform pathfinding if you supply a Path for him - he'll move along the exact path you supply.  For pathfinding, you want to use the Character: Move to point Action, and supply a Marker object that marks his intended destination.
  • ah didnt know there is a restriction. markers are not really a option for me cause i have a really big scene and with paths i have a better overview of what is going on. are there any plans to implement this in a future update? it should be the same logic like navmesh agents (SetDestination), or existing pathfinding in AC. or do you have any idea how i can archiev it?
  • You have the option of using Unity's NavMeshAgent for movement if you prefer - attach the NavMeshAgentIntegration component to your character.  You'll need to open up the script to see comments on how it works, and it can be copied and amended to suit.
  • i will give it maybe a try. maybe..if you have time you can integrate Simple Waypoint System =P
    it has every feature you need for a living world

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.