Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Custom area cost when updating path

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

  1. CrashKonijn

    CrashKonijn

    Joined:
    Mar 4, 2010
    Posts:
    248
    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