{{tag>dragonscript behavior}} [[:start|Start Page]] >> [[main|DragonScript Scripting Language]] >> [[dragengine:modules:dragonscript:abstractions|Abstraction Layers: How you want to build your Game]] >> [[dragengine:modules:dragonscript:behavior_elements|Behavior Elements]] >> **ECBehaviorNavigator** * [[behaviors_use_cases|Behaviors Explained: By Use-Case]] * [[behaviors_a_to_z|Behaviors Explained: From A to Z]] ====== ECBehaviorNavigator ====== Behavior element behavior adding navigator support for actors. Adds Navigator resource to actor. Actors use Navigator to find path around the game world using navigation spaces. Usually actors have one navigator but it is possible to have multiple navigators. Using different navigators path can be found and processed on different navigation space levels. By default the navigator has no cost types assigned. Actors set up the cost type in their actions. See also: * [[gamedev:navigation|Navigation System]] ====== Instance Counts ====== This behavior can be used multiple times on an element to add multiple navigators. Use the behavior identifier to tell them apart. ====== Element Class Properties ====== Element class properties have the prefix ''navigator.'' or ''navigator({id}).'' if id is not empty. ===== layer ===== Set layer. Only navigation spaces, navigation blockers and navgiators on the same layer affect each other. * Full name: ''navigator.layer'' or ''navigator({id}).layer'' * Type: integer * Default Value: 0 * Example (*.deeclass) 1 ===== spaceType ===== Set navigation space type to use. * Full name: ''navigator.spaceType'' or ''navigator({id}).spaceType'' * Type: enumeration * Allowed Values: ^Value^Description^ |''grid''|Navigation Grid.| |''mesh''|Navigation Mesh.| |''volume''|Navigation Volume.| * Default Value: ''mesh'' * Example (*.deeclass) grid ====== Events ====== This behavior has no events. ====== Required Behaviors ====== This behavior requires no other behaviors. ====== Optional Behaviors ====== This behavior does not support optional behaviors. ====== Persistency ====== This behavior does not required element class to be persistable (setPersistable). ====== API Documentation ====== #@LinkApiDocDEDS2_HTML~classDragengine_1_1Scenery_1_1ECBehaviorNavigator.html,ECBehaviorNavigator~@#. Since DragonScript Module Version ''1.0'' ====== Use Cases ====== * Allow actor to find path across navigation spaces. ====== Element Class Example ====== This example defines an element which supports navigation. class MyElement extends BehaviorElementClass public var ECBehaviorNavigator navigator func new() navigator = ECBehaviorNavigator.new(this) end end ====== Behavior Factory ====== Using element class supporting adding behaviors the behavior can be added like this: 1 ====== Live Examples ====== * [[https://github.com/LordOfDragons/deexamples|DEExamples Repository]]