Start Page » DragonScript Scripting Language » Behavior Elements: Quick and Easy Development » 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.
This behavior can be used only once on an element.
Element class properties have the prefix playerInputTurn.
.
Set turn left right speed in degrees per second.
playerInputTurn.speedTurnHorizontal
45
0
<float name='playerInputTurn.speedTurnHorizontal'>30</float>
This behavior has no events.
This behavior requires no other behaviors.
This behavior does not required element class to be persistable (setPersistable).
Since DragonScript Module Version 1.0
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
Using element class supporting adding behaviors the behavior can be added like this:
<?xml version='1.0' encoding='UTF-8'?> <elementClass name='MyClass' class='GenericBehaviorElement'> <behavior type='ECBehaviorPlayerInputTurn'> <!-- set element properties. omit property prefix if used inside behavior tag --> <string name='.name'>Color 1</string> </behavior> </elementClass>