This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
dragengine:modules:dragonscript:behavior_interactionspot [2020/11/23 16:08] – dragonlord | dragengine:modules:dragonscript:behavior_interactionspot [2024/03/14 16:54] (current) – dragonlord | ||
---|---|---|---|
Line 16: | Line 16: | ||
Elements able to occupy an interaction spot have to use the [[behavior_occupier|ECBehaviorOccupier]] behavior. Both the interaction spot and the occupier have to persist the other behavior. During restoring no notifications are triggered this way. | Elements able to occupy an interaction spot have to use the [[behavior_occupier|ECBehaviorOccupier]] behavior. Both the interaction spot and the occupier have to persist the other behavior. During restoring no notifications are triggered this way. | ||
+ | |||
+ | <WRAP center 100%> | ||
+ | <WRAP center box 450px> | ||
+ | {{youtube> | ||
+ | <WRAP centeralign> | ||
+ | </ | ||
+ | </ | ||
====== Instance Counts ====== | ====== Instance Counts ====== | ||
Line 56: | Line 63: | ||
====== API Documentation ====== | ====== API Documentation ====== | ||
- | [[https:// | + | # |
Since DragonScript Module Version **1.4** | Since DragonScript Module Version **1.4** | ||
Line 73: | Line 80: | ||
| | ||
- | // Create component and collider to give element a look and feeling | + | |
- | | + | component = ECBehaviorComponent.new(this) |
- | | + | collider = ECBehaviorCollider.new(this, |
- | | + | |
- | | + | // Create interaction spot in front of the element. Typically actors need |
- | | + | // to be rotated by 180 degrees to interact with elements since then the |
- | | + | // actor is looking at the front side of the element. |
- | | + | // |
- | | + | // This behavior is named " |
- | | + | // it allows to add multiple interaction spots. This can be because the |
- | | + | // element has more than one possible interaction or different spots the |
- | | + | // same type of interaction can be used. Think of a bench having 3 seats |
- | | + | // to sit down. This allows three actors to use the bench but with each |
- | | + | // seat occupied by only one actor |
- | | + | interactionSpot = ECBehaviorInteractionSpot.new(this, |
- | | + | interactionSpot.getPosition().setVector(Vector.new(0, |
- | | + | interactionSpot.getOrientation().setVector(Vector.new(0, |
- | | + | interactionSpot.getLookAt().setVector(Vector.new(0, |
end | end | ||
end | end | ||
</ | </ | ||
+ | |||
+ | In the [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// |