{{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]] >> **ECBehaviorPlayerInputTurn** * [[behaviors_use_cases|Behaviors Explained: By Use-Case]] * [[behaviors_a_to_z|Behaviors Explained: From A to Z]] ====== ECBehaviorPlayerInputTurn ====== Behavior element behavior adding turning player input. Keeps track of turning player input and applies them to actor locomotion. This behavior is typically used for vehicle type actors. ====== Instance Counts ====== This behavior can be used only once on an element. ====== Element Class Properties ====== Element class properties have the prefix ''playerInputTurn.'' . ===== speedTurnHorizontal ===== Set turn left right speed in degrees per second. * Full name: ''playerInputTurn.speedTurnHorizontal'' * Type: float * Default Value: ''45'' * Restriction: At least ''0'' * Example (*.deeclass) 30 ====== Events ====== This behavior has no events. ====== Required Behaviors ====== This behavior requires no other behaviors. ====== Optional Behaviors ====== * [[behavior_locomotion|ECBehaviorLocomotion]]: Update locomotion turning parameters. ====== Persistency ====== This behavior does not required element class to be persistable (setPersistable). ====== API Documentation ====== #@LinkApiDocDEDS2_HTML~classDragengine_1_1Scenery_1_1ECBehaviorPlayerInputTurn.html,ECBehaviorPlayerInputTurn~@#. Since DragonScript Module Version ''1.0'' ====== Use Cases ====== * Track player turning input and apply it to locomotion. ====== Element Class Example ====== This example defines an element which tracks player turning input. class MyElement extends BehaviorElementClass public var ECBehaviorPlayerInputTurn playerInputTurn func new() playerInputTurn = ECBehaviorPlayerInputTurn.new(this) end end ====== Behavior Factory ====== Using element class supporting adding behaviors the behavior can be added like this: Color 1 ====== Live Examples ====== * [[https://github.com/LordOfDragons/deexamples|DEExamples Repository]]