This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| dragengine:modules:dragonscript:behavior_touchsensor [2025/05/02 15:19] – dragonlord | dragengine:modules:dragonscript:behavior_touchsensor [2026/11/20 16:51] (current) – [touchSensor.set] dragonlord | ||
|---|---|---|---|
| Line 30: | Line 30: | ||
| Element class properties have the prefix '' | Element class properties have the prefix '' | ||
| + | |||
| + | ===== bone ===== | ||
| + | |||
| + | Bone to attach resource to. If empty string attach to collider. | ||
| + | |||
| + | * Full name: '' | ||
| + | * Type: string | ||
| + | * Default Value: empty string | ||
| + | * Example (*.deeclass) <code xml>< | ||
| + | |||
| + | ===== collisionFilter ===== | ||
| + | |||
| + | Set [[gamedev: | ||
| + | * Full name: '' | ||
| + | * Type: string. Format can be '' | ||
| + | * Default Value: '' | ||
| + | * Example (*.deeclass) <code xml>< | ||
| + | |||
| + | ===== orientation ===== | ||
| + | |||
| + | Orientation to attach resource to collider in degrees. | ||
| + | |||
| + | * Full name: '' | ||
| + | * Type: 3-component float vector | ||
| + | * Default Value: (0,0,0) | ||
| + | * Example (*.deeclass) <code xml>< | ||
| + | |||
| + | ===== position ===== | ||
| + | |||
| + | Position to attach resource to collider. | ||
| + | |||
| + | * Full name: '' | ||
| + | * Type: 3-component float vector | ||
| + | * Default Value: (0,0,0) | ||
| + | * Example (*.deeclass) <code xml>< | ||
| ===== shape ===== | ===== shape ===== | ||
| Line 57: | Line 92: | ||
| * Default Value: '' | * Default Value: '' | ||
| * Example (*.deeclass) <code xml>< | * Example (*.deeclass) <code xml>< | ||
| - | |||
| - | ===== position ===== | ||
| - | |||
| - | Position to attach resource to collider. | ||
| - | |||
| - | * Full name: '' | ||
| - | * Type: 3-component float vector | ||
| - | * Default Value: (0,0,0) | ||
| - | * Example (*.deeclass) <code xml>< | ||
| - | |||
| - | ===== orientation ===== | ||
| - | |||
| - | Orientation to attach resource to collider in degrees. | ||
| - | |||
| - | * Full name: '' | ||
| - | * Type: 3-component float vector | ||
| - | * Default Value: (0,0,0) | ||
| - | * Example (*.deeclass) <code xml>< | ||
| - | |||
| - | ===== bone ===== | ||
| - | |||
| - | Bone to attach resource to. If empty string attach to collider. | ||
| - | |||
| - | * Full name: '' | ||
| - | * Type: string | ||
| - | * Default Value: empty string | ||
| - | * Example (*.deeclass) <code xml>< | ||
| ====== Events ====== | ====== Events ====== | ||
| Line 90: | Line 98: | ||
| Element entered touch sensor. | Element entered touch sensor. | ||
| - | |||
| ===== elementLeft ===== | ===== elementLeft ===== | ||
| Line 109: | Line 116: | ||
| ^Parameter^Value^Description^ | ^Parameter^Value^Description^ | ||
| + | |collisionFilter.filter.set|string|Set named [[gamedev: | ||
| + | |collisionFilter.filter.clear|string|Clear named [[gamedev: | ||
| |enabled|'' | |enabled|'' | ||
| Line 115: | Line 124: | ||
| <action name=' | <action name=' | ||
| < | < | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | ===== touchSensor.update ===== | ||
| + | |||
| + | Update touch sensor. | ||
| + | |||
| + | ^Parameter^Value^Description^ | ||
| + | |touching.runEvent|string|Run state machine event on all touching elements supporting [[behavior_statemachine|ECBehaviorStateMachine]]| | ||
| + | |||
| + | This is an example of using this action: | ||
| + | <code xml> | ||
| + | <action name=' | ||
| + | < | ||
| </ | </ | ||
| </ | </ | ||
| Line 128: | Line 151: | ||
| |count.greater|integer|Count of touching elements is greater than integer value| | |count.greater|integer|Count of touching elements is greater than integer value| | ||
| |player|'' | |player|'' | ||
| + | |wait| |If present action returns BTResult.running instead of BTResult.failed to wait until the checks are all fulfilled| | ||
| This is an example of using this action: | This is an example of using this action: | ||
| Line 161: | Line 185: | ||
| </ | </ | ||
| </ | </ | ||
| + | |||
| + | ====== State Machine Actions ====== | ||
| + | |||
| + | Same as [[# | ||
| + | |||
| + | ====== State Machine Conditions ====== | ||
| + | |||
| + | Same as [[# | ||
| + | |||
| + | ====== State Machine Events ====== | ||
| + | |||
| + | This behavior sends these state machine events. If behavior has non-empty identifier replace '' | ||
| + | |||
| + | ===== touchSensor.entered ===== | ||
| + | |||
| + | Element entered touch sensor. Element is send as event parameter. Use [[behavior_statemachine# | ||
| + | |||
| + | ===== touchSensor.left ===== | ||
| + | |||
| + | Element left touch sensor. Element is send as event parameter. Use [[behavior_statemachine# | ||
| ====== Required Behaviors ====== | ====== Required Behaviors ====== | ||
| Line 170: | Line 214: | ||
| * [[behavior_collider|ECBehaviorCollider]]: | * [[behavior_collider|ECBehaviorCollider]]: | ||
| * [[behavior_behaviortree|ECBehaviorBehaviorTree]]: | * [[behavior_behaviortree|ECBehaviorBehaviorTree]]: | ||
| + | * [[behavior_statemachine|ECBehaviorStateMachine]]: | ||
| ====== Persistency ====== | ====== Persistency ====== | ||
| Line 212: | Line 257: | ||
| | | ||
| < | < | ||
| - | <!-- optional: | + | <!-- optional: |
| - | category BaseGameApp.CollisionFilterBit.trigger | + | <string name='behaviorTree'> |
| - | filter BaseGameApp.CollisionFilterBit.actorAI. | + | |
| - | | + | < |
| - | are a list of bits to set. --> | + | <string name='stateMachine'>second</ |
| - | <string name='collisionFilter'>3:4 0</ | + | |
| | | ||
| <!-- set element properties. omit property prefix if used inside behavior tag --> | <!-- set element properties. omit property prefix if used inside behavior tag --> | ||