navigation_different_actor_area_access.rst 1.4 KB

123456789101112131415161718192021222324252627282930
  1. .. _doc_navigation_different_actor_area_access:
  2. Support different actor area access
  3. ===================================
  4. .. image:: img/nav_actor_doors.png
  5. A typical example for different area access in gameplay are doors that connect rooms
  6. with different navigation meshes and are not accessible by all actors all the time.
  7. Add a NavigationRegion at the door position.
  8. Add an appropriate navigation mesh the size of the door that can connect with the surrounding navigation meshes.
  9. In order to control access, enable / disable navigation layer bits so path queries
  10. that use the same navigation layer bits can find a path through the "door" navigation mesh.
  11. The bitmask can act as a set of door keys or abilities and only actors with at least
  12. one matching and enabled bit layer in their pathfinding query will find a path through this region.
  13. See :ref:`doc_navigation_advanced_using_navigationlayers` for more information on how to work with navigation layers and the bitmask.
  14. .. image:: img/nav_actor_doorbitmask.png
  15. The entire "door" region can also be enabled / disable if required but if disabled will block access for all path queries.
  16. Prefer working with navigation layers in path queries whenever possible as enabling or disabling
  17. navigation layers on a region triggers a costly recalculation of the navigation map connections.
  18. .. warning::
  19. Changing navigation layers will only affect new path queries but not automatically update existing paths.