Difference between revisions of "Touch start"

From Second Life Wiki
Jump to: navigation, search
(added Issues/SVC-3017)
m
Line 27: Line 27:
 
|also_articles
 
|also_articles
 
|also_footer
 
|also_footer
|notes
+
|notes=Do not change states from within the touch_start() event, since this will prevent the touch_end() event being called even if you did not define it. The perform state transitions use the touch_end() event instead!
 
|mode
 
|mode
 
|deprecated
 
|deprecated

Revision as of 13:07, 20 March 2009

Description

! Event: touch_start( integer num_detected ){ ; }

Triggered by the start of agent clicking on task

• integer num_detected Number of agents detected touching during the last clockcycle

Caveats

  • When changing from a state that lacks a touch event into a state that has a touch event, the first touch will be dropped; this effects all three touch events (touch_start, touch, touch_end). See: SVC-3017

Important Issues

~ All Issues ~ Search JIRA for related Bugs
   Server drops first touch event when a script returns to a state with a touch_start handler

Examples

You can use numbers 0 through num_detected - 1 to get detected agent keys: <lsl>default {

   touch_start(integer num_detected)
   {
       integer i = 0;
       for(; i<num_detected; ++i)
           llWhisper(0, "Touched by " + llKey2Name(llDetectedKey(i)));
   }

}</lsl>

Notes

Do not change states from within the touch_start() event, since this will prevent the touch_end() event being called even if you did not define it. The perform state transitions use the touch_end() event instead!

See Also

Events

•  touch
•  touch_end

Functions

•  llSetTouchText
•  llPassTouches

Deep Notes

Issues

All Issues

~ Search JIRA for related Issues
   Server drops first touch event when a script returns to a state with a touch_start handler

Signature

event void touch_start( integer num_detected );