This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
dragengine:modules:dragonscript:behavior_vrhandpointedat [2021/11/04 19:24] – created dragonlord | dragengine:modules:dragonscript:behavior_vrhandpointedat [2025/03/12 21:31] (current) – dragonlord | ||
---|---|---|---|
Line 14: | Line 14: | ||
====== Instance Counts ====== | ====== Instance Counts ====== | ||
- | This behavior can be used only once on an element. The behavior always has identifier empty string. | + | |
+ | This behavior can be used only once on an element. | ||
====== Element Class Properties ====== | ====== Element Class Properties ====== | ||
- | Element class properties have the prefix | + | |
+ | Element class properties have the prefix | ||
This behavior defines no element class properties. | This behavior defines no element class properties. | ||
+ | |||
+ | ====== Events ====== | ||
+ | |||
+ | ===== handStartsPointingAt ===== | ||
+ | |||
+ | Hand starts pointing at element. | ||
+ | |||
+ | ===== handStopsPointingAt ===== | ||
+ | |||
+ | Hand stops pointing at element. | ||
====== Required Behaviors ====== | ====== Required Behaviors ====== | ||
+ | |||
This behavior does not required other behaviors to be present. | This behavior does not required other behaviors to be present. | ||
====== Optional Behaviors ====== | ====== Optional Behaviors ====== | ||
+ | |||
This behavior does not support optional behaviors. | This behavior does not support optional behaviors. | ||
====== Persistency ====== | ====== Persistency ====== | ||
+ | |||
This behavior does support element class to be persistable (setPersistable). | This behavior does support element class to be persistable (setPersistable). | ||
- | |||
- | Saves the list of [[behavior_vrhandpointat|ECBehaviorVRHandPointAt]] pointing at the element. | ||
- | |||
- | ====== Events ====== | ||
- | This behavior supports adding listeners. These events can be received: | ||
- | |||
- | ===== handStartsPointingAt ===== | ||
- | [[behavior_vrhandpointat|ECBehaviorVRHandPointAt]] starts pointing at object. Event contains [[behavior_vrhandpointat|ECBehaviorVRHandPointAt]] pointing at object. | ||
- | |||
- | ===== handStopsPointingAt ===== | ||
- | [[behavior_vrhandpointat|ECBehaviorVRHandPointAt]] stops pointing at object. Event contains [[behavior_vrhandpointat|ECBehaviorVRHandPointAt]] no more pointing at object. | ||
- | |||
====== API Documentation ====== | ====== API Documentation ====== | ||
- | [[https:// | + | # |
- | Since DragonScript Module Version | + | Since DragonScript Module Version |
====== Use Cases ====== | ====== Use Cases ====== | ||
+ | |||
* Show outline and interact prompts if player points at object. | * Show outline and interact prompts if player points at object. | ||
* For NPCs to react to player (or other actors) pointing at them (for example looking back at player). | * For NPCs to react to player (or other actors) pointing at them (for example looking back at player). | ||
Line 66: | Line 70: | ||
end | end | ||
</ | </ | ||
+ | |||
+ | ====== Behavior Factory ====== | ||
+ | |||
+ | Using element class supporting adding behaviors the behavior can be added like this: | ||
+ | <code xml> | ||
+ | <?xml version=' | ||
+ | < | ||
+ | < | ||
+ | <!-- set element properties. omit property prefix if used inside behavior tag --> | ||
+ | <string name=' | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ====== Live Examples ====== | ||
+ | |||
+ | * [[https:// | ||
+ |