User Tools

Site Tools


dragengine:modules:dragonscript:behavior_touching

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
dragengine:modules:dragonscript:behavior_touching [2025/03/13 16:41] – created dragonlorddragengine:modules:dragonscript:behavior_touching [2025/05/02 15:30] (current) – [Behavior Tree Actions] dragonlord
Line 1: Line 1:
 {{tag>dragonscript behavior}} {{tag>dragonscript behavior}}
 <WRAP youarehere> <WRAP youarehere>
-[[:start|Start Page]] >> [[main|DragonScript Scripting Language]] >> [[abstractions#behavior_elementsquick_and_easy_development|Behavior Elements: Quick and Easy Development]] >> **ECBehaviorTouching**+[[: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]] >> **ECBehaviorTouching**
 </WRAP> </WRAP>
  
Line 54: Line 54:
  
 Last element left touch sensor. Last element left touch sensor.
 +
 +====== Behavior Tree Actions ======
 +
 +The [[behavior_touchsensor|ECBehaviorTouchSensor]] behavior adds behavior tree actions if behavior tree is present. See [[behavior_touchsensor#behavior_tree_actions|ECBehaviorTouchSensor Behavior Tree Actions]]. Replace ''touchSensor'' with ''touching.touchSensor'' or ''touching(id).touchSensor''.
 +
 +This is an example of using touch sensor behavior tree actions:
 +<code xml>
 +<action name='touching.touchSensor.set'>
 +  <parameter name='enabled'>true</parameter>
 +</action>
 +</code>
 +
 +<code xml>
 +<sequence>
 +  <action name='touching.touchSensor.check'>
 +    <parameter name='player'>true</parameter>
 +  </action>
 +  <!-- actions here run only if player is touching touch sensor -->
 +</sequence>
 +</code>
 +
 +====== Behavior Tree Conditions ======
 +
 +The [[behavior_touchsensor|ECBehaviorTouchSensor]] behavior adds behavior tree conditions if behavior tree is present. See [[behavior_touchsensor#behavior_tree_conditions|ECBehaviorTouchSensor Behavior Tree Conditions]]. Replace ''touchSensor'' with ''touching.touchSensor'' or ''touching(id).touchSensor''.
 +
 +This is an example of using touch sensor behavior tree conditions:
 +<code xml>
 +<action name='myAction' id='doing something'>
 +  <parameter name='touching.touchSensor.player'>true</parameter>
 +  <condition>touching.touchSensor.check</condition>
 +</action>
 +</code>
  
 ====== Required Behaviors ====== ====== Required Behaviors ======
Line 62: Line 94:
  
   * [[behavior_collider|ECBehaviorCollider]]: Attach child touch sensor to collider.   * [[behavior_collider|ECBehaviorCollider]]: Attach child touch sensor to collider.
 +  * [[behavior_behaviortree|ECBehaviorBehaviorTree]]: Add actions and conditions for behavior trees to use.
 +
  
 ====== Persistency ====== ====== Persistency ======
dragengine/modules/dragonscript/behavior_touching.1741884079.txt.gz · Last modified: 2025/03/13 16:41 by dragonlord