1/7/2024 0 Comments Player api roblox![]() If this were with button presses or mouse-clicks, your solution would work fine. The heart of what you're doing is sound : start blocking after the first event, and unblock some time later. Print("Hello! onTouchedUndebounced() has run.") īox.TouchEnded:Connect(onTouchedUndebounced) Print("Hello! onTouchedDebounced() has run.") īox.Touched:Connect(onTouchedDebounced)) But, I don't know how to do that properly. I then try to "un-debounce" when the player's model is outside out of the box's model. So, with a variable (of type boolean) that stores a debounce flag, that solves it. ![]() Without debounce, upon event firing, the callback function is invoked by connect() or the event handler (not sure), and, without debouncing, the function is invoked multiple times as print statements are repeated on the output box. I honestly don't understand what is happening under the hood so its hard to figure out. ![]() Just a player and a part (rectangular prism) that's floating in the air and anchored.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |