I have my move ai working fine except that they don't walk around my fence very well, they try to go in a straight line. I have tried both the default and Nav Mesh option to no avail. I just want some simple obstacle avoidance. What can I do?
  • The built-in simple movement component for the move AI does only run directly to the target.

    You'll need to use NavMesh to have object avoidance. For that, you'll need to set it up correctly. If your baked NavMesh mesh in the scene doesn't show a gap around your fence, it's not registered as something that needs to be avoided - this could be e.g. due to not being set static, or you could add a Nav Mesh Obstacle component to it.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • I have the nav mesh baked correctly. All obstacles are set to 'static' and are placed on the terrain so there are gaps where the AI can't walk like my fence where the blue mesh doesn't touch.

    Ill try adding the component you suggested. What about my AI prefab, do I need to add any components to it as well? Thanks
  • So the AI moves but still doesn't avoid obstacles, still walks in a straight path. I have the character auto equip the component, run tha game and paused to make sure it was added and it was. Check. I added the 'Nav Mesh Obstacle' component to my fence as well but it tries to walk through it and not around by following the blue navmesh
  • I have Apex path so I can save you the stress of trying to figure this out if you can advise me on how to integrate it. The only problem is Ork is asking me for Speed, Stop and Position methods of which I have no idea. I'll try looking at the scripts in the time being but I'm not a coder so wish me luck with that
  • edited July 2015
    Did you select the Nav Mesh Agent movement component in the move AI's settings? Otherwise it's not using NavMesh for movement :)
    Post edited by gamingislove on
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited July 2015
    Yep I selected that option and chose 'add component'. When I ran the game, I paused it and looked at the clone prefab and the 'nav mesh agent' component was added indeed. It just doesn't know how to go around obstacles. There's not even a blue navmesh close to the objects eith because I have a big enough radius.

    If I can get that figured out it would be good because since getting back to Ork last week from a few months break I practically ran through half the Game Tutorials and everything else is going smoothly
    Post edited by gimme on
  • I did some research on the unity navigation and it seems it's not so great. I have Apex path. Any idea how to integrate it with ork as I see a 'custom' navigation option
  • I didn't have any problems with NavMesh avoiding stuff.

    When using custom navigation scripts, you need a component attached to the combatant's game object that has 3 functions, one for setting a destination, one for setting the speed and one for stopping. You can find details on this in the help texts of the settings in the move AI.
    Either your navigation scripts already have a component with compatible functions, or you need to write a wrapper component that calls your navigation functions.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Ok well I barely know any coding so that's why I am asking for help. I don't know anything about wrappers. I have the scripts from Apex but I don't know specifically where to find what methods Ork is asking. I just know based on th eApex tutorials what scripts to add, but referencing METHODS to Ork is another things....I guess I will have to fight this one alone. Thanks though
  • @gimmie send me a PM with the scripts that go on the player an ill write comments in the sections you need
    new website can be found here http://www.fore-loregames.com

    Follow the game Development on Twitter https://twitter.com/Fore_Lore_Games

    or check out the face book page here https://www.facebook.com/ForeLoreGames
  • edited July 2015
    im also using unity navigation an never seem to have an issue with it sept when it was ported from unity 4. but that turned out to be a space at the end of the scene name that caused the issue.


    other things you can try ti going into the project folder project settings an deleting all the navigation stuff from there and then clear an rebake the nav mesh
    Post edited by wtyson on
    new website can be found here http://www.fore-loregames.com

    Follow the game Development on Twitter https://twitter.com/Fore_Lore_Games

    or check out the face book page here https://www.facebook.com/ForeLoreGames
  • Thanks @Wtyson. I'll send the scripts in a few minutes
  • sorry ill take a look at them over the weekend and see what i can do you basically need the 3 methods that need to be called right? or do you need the fields as well?
    new website can be found here http://www.fore-loregames.com

    Follow the game Development on Twitter https://twitter.com/Fore_Lore_Games

    or check out the face book page here https://www.facebook.com/ForeLoreGames
  • Ork is asking for the methods. If you have time you can give me the fields just in case. I'm taking a c# class soon so I wanna get more familiar with these things as well. Thanks man. If you have any problems with the link I pm'd lemme know
  • You'll pretty much need those functions:

    public void MoveTo(Vector3 position)
    {
    // set navigation target
    }

    public void SetSpeed(float speed)
    {
    // set speed
    }

    public void Stop()
    {
    // stop your navigation
    }
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.