LLEvents:once() with "touch_start" misses the first touch after reset in the editor
in progress
SuzannaLinn Resident
local function start()
print("touched")
end
LLEvents:once("touch_start", start)
[save script]
(pointer is hand)
[touching]
-- > touched
(pointer is arrow)
[reset script in the editor]
(pointer is hand)
[touching]
(nothing) <- missed the first touch
(pointer is hand)
[touching]
-- > touched <- got the second touch
(pointer is arrow)
---
Works well with:
- Reset the script in the editor
- Take the object to inventory
- Rezz the object
- Touch -- > touched
---
Works well with LLEvents:on():
local function start()
print("touched")
end
LLEvents:on("touch_start", start)
Log In
SuzannaLinn Resident
A similar behaviour in LSL (in all of them Luau, Mono and Legacy):
default {
touch_start(integer num) {
llOwnerSay("touched");
state two;
}
}
state two{
state_entry() {
llOwnerSay("two");
}
}
[save script]
(pointer is hand)
[touching]
-- > touched
-- > two
(pointer is arrow)
[reset script in the editor]
(pointer is hand)
[touching]
(nothing) <- missed the first touch
(pointer is hand)
[touching]
-- > touched <- got the second touch
-- > two
(pointer is arrow)
H
Harold Linden
marked this post as
in progress
Interesting, was able to repro with
LLEvents:once('touch_start', print)
.If I had to guess, this is something to do with the dynamic handler unregistration hooks that call out to the simulator. Having a look now.