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

Custom area cost when updating path

Discussion in 'Navigation' started by CrashKonijn, Oct 19, 2015.

  1. CrashKonijn

    CrashKonijn

    Joined:
    Mar 4, 2010
    Posts:
    242
    Hello,

    I'm currently working on AI for our game, since we want full control over our AI movement we're thinking about writing our own movement instead of using the NavMeshAgent. We've split our levels in many area's and are planning on using the NavMeshCost to make an AI avoid certain area's when moving from A to B, for example when an area is a danger to it's current task.

    A NavMeshAgent has a function called NavMesh.SetAreaCost so each enemy can have their own costs for each room. My whole team has looked into it but we can't seem to find a good way of re-creating this behaviour. The only thing we've come up with is setting the global settings before updating each path, but this doesn't seem like the best way this could be done.

    Does anyone have a better idea of doing this?

    Kind regards,

    Peter