|
Learjeff Innis
musician & coder
Join date: 27 Nov 2006
Posts: 817
|
12-21-2006 10:45
Why do I often get multiple touch_start() or touch_end() events when touching an object once?
If the object is movable and it's moved by touching, I get lots and lots of touch_start() events, and touch_end() is better but still not debounced. Even the default "new script" will show this problem for touch_start(). Most likely it happens if the mouse moves while the button is down.
I know how to debounce (using a timer and/or state variable, depending on behavior). But shouldn't these events be debounced already? Seems like a bug to me, and there's no mention of it on the LSL wiki.
Thanks Jeff
|
|
Boss Spectre
Registered User
Join date: 5 Sep 2005
Posts: 229
|
12-21-2006 10:53
I tried it with a single box prim and the default new script, with and without the object set to physical, and I only get one touch_start event per left click, even with rotating or dragging it around. Do you see this behavior with a single prim? If not, try checking llDetectedLinkNumber() in your touch event, to see if multiple prims are triggering it in the root prim.
|
|
Zaphod Kotobide
zOMGWTFPME!
Join date: 19 Oct 2006
Posts: 2,087
|
12-22-2006 13:05
is it always the same number of touch_start events? If it seems random, try a different mouse too.. I had a similar (not really similar, but comparable) experience a while back and it turned out the left button on my mouse was actuating as the pressure on it varied.. which would be inevitable when holding and especially moving.
|