TouchEvent
two entities starting or stopping contact this frame
Fields
3 members
Reacting to Contacts That Began
Lifecycle: Shared
Draining hands over the contacts recorded since the last call and empties the buffer, so a pair is reported once.
Luau
local events, dropped = game.Physics.DrainTouchEvents()if dropped then warn("Contact buffer overflowed; some pairs were lost")endfor _, event in ipairs(events) do if event.began then print(string.format("%s touched %s", event.a.Name, event.b.Name)) endend