User Tools

Site Tools


dragengine:modules:dragonscript:behavior_playerinputcrouch

ECBehaviorPlayerInputCrouch

Behavior element behavior adding crouching player input.

Keeps track of crouching player input and applies them to actor locomotion.

Instance Counts

This behavior can be used only once on an element.

Element Class Properties

Element class properties have the prefix playerInputCrouch. .

Events

This behavior has no events.

Required Behaviors

This behavior requires no other behaviors.

Optional Behaviors

Persistency

This behavior does support element class to be persistable (setPersistable).

API Documentation

ECBehaviorPlayerInputCrouch.

Since DragonScript Module Version 1.0

Use Cases

  • Track player input for crouching

Element Class Example

This example defines an element which tracks player crouching input.

class MyElement extends BehaviorElementClass
  public var ECBehaviorPlayerInputCrouch playerInputCrouch
  func new()
    playerInputCrouch = ECBehaviorPlayerInputCrouch.new(this)
  end
end

Behavior Factory

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='ECBehaviorPlayerInputCrouch'>
    <!-- set element properties. omit property prefix if used inside behavior tag -->
    <string name='.name'>value</string>
  </behavior>
</elementClass>

Live Examples

You could leave a comment if you were logged in.
dragengine/modules/dragonscript/behavior_playerinputcrouch.txt · Last modified: 2025/03/13 11:30 by dragonlord