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 22:34] – 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 108: | 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 114: | 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 127: | 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 175: | Line 200: | ||
| ===== touchSensor.entered ===== | ===== touchSensor.entered ===== | ||
| - | Element entered touch sensor. | + | Element entered touch sensor. Element is send as event parameter. Use [[behavior_statemachine# |
| ===== touchSensor.left ===== | ===== touchSensor.left ===== | ||
| - | Element left touch sensor. | + | Element left touch sensor. Element is send as event parameter. Use [[behavior_statemachine# |
| ====== Required Behaviors ====== | ====== Required Behaviors ====== | ||
| Line 232: | Line 257: | ||
| | | ||
| < | < | ||
| - | <!-- optional: set collision filter. default value ' | ||
| - | | ||
| - | | ||
| - | | ||
| - | are a list of bits to set. --> | ||
| - | <string name=' | ||
| - | | ||
| <!-- optional: use behavior tree with id instead of empty string --> | <!-- optional: use behavior tree with id instead of empty string --> | ||
| <string name=' | <string name=' | ||