Jump to content

LlDetectedTouchPos

From OSgrid Wiki

Function: vector llDetectedTouchPos( integer index );

Returns a vector that is the position where the object was touched in region coordinates, unless it is attached to the HUD, in which case it returns the position relative to the attach point.
• integer index – Index of detection information

index does not support negative indexes.
For the touch category of events only. The prim that was touched may not be the prim receiving the event, use llDetectedLinkNumber to check for this; likewise you can use llDetectedTouchFace to determine which face was touched.

Caveats
TOUCH_INVALID_VECTOR is returned when...

• The avatar's viewer does not support face touch detection.
-• To check if face touch detection is supported check the return of llDetectedTouchFace.
• The touch has moved off the surface of the prim.
• The triggering event is not a touch event.

Examples

<source lang="lsl">

default {

   touch_start(integer pos_detected)
   {
       integer i = 0;
       for(; i<pos_detected; ++i)
           llWhisper(0, "Pos clicked: " + (string)llDetectedTouchPos(i));
   }

} </source>


See Also
Events
• touch_start
• touch
• touch_end
Functions
• llDetectedLinkNumber
• llDetectedTouchFace
• llDetectedTouchST
• llDetectedTouchUV
• llDetectedTouchNormal
• llDetectedTouchBinormal