Is task.wait broken?

  Рет қаралды 2,945

sleitnick

sleitnick

19 күн бұрын

Let's put our assumptions to the test!

Пікірлер: 46
@sleitnick1
@sleitnick1 16 күн бұрын
Some clarification: - The demonstration shows that `task.wait()` does exactly what it is supposed to do; our assumption that it always waits a frame is wrong. - As framerates are dynamic, there's no magic number to plug into `task.wait()` to wait 1 frame. You as the dev are responsible for understanding this behavior and acting accordingly. - I did not use the global `wait()` function because it is deprecated.
@Deniied
@Deniied 16 күн бұрын
Please do not expose the backdoor in the ROBLOX Source code.
@mogaming163
@mogaming163 17 күн бұрын
🗣🔥WE MAKING IT OUT OF DOCUMENTATION WITH THIS ONE 🔥 Already knew this but I'll be using this to explain it to others so thank you!
@aminaye1316
@aminaye1316 16 күн бұрын
Watching this has given me a sudden urge to look at the Roblox engine functions and try to catch anything niche with them, adding more depth to my knowledge, i'd like to see more videos like this :)
@kylehickmen1684
@kylehickmen1684 16 күн бұрын
parallel lua video in the works?
@crusherfire1
@crusherfire1 16 күн бұрын
This was very neat! I enjoy these kinds of videos :)
@seadrown6252
@seadrown6252 15 күн бұрын
You're goated
@maxwell_edison
@maxwell_edison 17 күн бұрын
Crazy useful to know! Should be easy enough to workaround.
@BrawlDevRBLX
@BrawlDevRBLX 16 күн бұрын
Fascinating
@Mars-ws9cm
@Mars-ws9cm 17 күн бұрын
yay new video!
@jukepilot
@jukepilot 17 күн бұрын
e_2
@MS-lb9yd
@MS-lb9yd 16 күн бұрын
What studio theme do u use?
@KashTheKingYT
@KashTheKingYT 13 күн бұрын
Very cool
@Curtis_11
@Curtis_11 17 күн бұрын
Is there a particular reason why task.wait waits until the next heartbeat and not the next render step internally? What's the point of that minuscule difference if it's causing unintended behavior?
@binaryparrot3352
@binaryparrot3352 16 күн бұрын
RenderStepped runs right before rendering the frame. The server does not render anything, thus never runs RenderStepped. Also slow running slow code in RenderStepled can significantly drop the frame rate.
@Curtis_11
@Curtis_11 16 күн бұрын
@@binaryparrot3352 Ahh right, I see that now. Thanks
@wedoalittletrolling723
@wedoalittletrolling723 16 күн бұрын
@@binaryparrot3352 I mean server can run RenderStepped in studio, but only in studio because of the server window you can switch to. Live games will never have this effectively making RenderStepped on the server useless
@clocky5018
@clocky5018 17 күн бұрын
thanks!
@eliteengineer7340
@eliteengineer7340 16 күн бұрын
I just dont use task.wait() without args, its ambious and doesnt make sense, if you want to wait a frame wait a frame
@wedoalittletrolling723
@wedoalittletrolling723 16 күн бұрын
fr, or even just learn how to time events using delta time
@sleitnick1
@sleitnick1 16 күн бұрын
I don't understand what you mean, "if you want to wait a frame wait a frame." That's exactly what I'm demonstrating doesn't work as expected. Even if you put `task.wait(0)` you will end up with the same thing. Frames vary in timing, so there's no secret number that waits 1 frame. You as a dev need to be conscious about your current invocation cycle to properly wait a frame.
@eliteengineer7340
@eliteengineer7340 16 күн бұрын
@@sleitnick1 i mean , just runservice.renderstepped:wait() or heartbeat or whatever else you need. That way its more clear whats going on. task.wait might have a specific definition but it's not intuitive what it does.
@eliteengineer7340
@eliteengineer7340 16 күн бұрын
@@sleitnick1 I mean that since task.wait() is so ambigous just use RunService.Heartbeat:Wait() or the other events, since they are more specific , it's more intuitive , you know exactly whats going on
@ZeroManYT
@ZeroManYT 16 күн бұрын
Could you not just do task.wait(1) in the instances where the time diffrences are the same , although i agree dose seem to be broke.
@yourcomputerhasdied
@yourcomputerhasdied 17 күн бұрын
task.wait() waits until a Heartbeat, and wait() doesn't The question is, what does wait() wait for?
@bacon_208
@bacon_208 17 күн бұрын
task.wait() waits for the time given then heartbeat wait() waits for the time given and does other stuff you never asked it to do unless the joke is that you haven't provided an arg which in that case, it do be like that...
@littensy
@littensy 17 күн бұрын
wait() is based on an older 30hz system, and the minimum it will wait is 29ms!
@Focusluvyou
@Focusluvyou 17 күн бұрын
​@@littensy source?
@radwl
@radwl 16 күн бұрын
wait() has some dark magic type of waiting that is meant to wait for like 30ms, but in reality it can wait as much as a minute, nobody knows why, but at some point in development your wait() will start to get slower and slower and can go up to tens of seconds of delay to each wait that you use
@koye4427
@koye4427 16 күн бұрын
wait() uses an old, throttled system that may or may not resume execution after some time has passed
@StarJ3M
@StarJ3M 17 күн бұрын
hi guys
@HashCollision
@HashCollision 17 күн бұрын
Thanks for explaining all this, Sleitnick.
@minerssp4363
@minerssp4363 17 күн бұрын
How is your life goin?
@ahmoin
@ahmoin 16 күн бұрын
task.wait(), what?
@miffclick3358
@miffclick3358 17 күн бұрын
Stop click baiting.
@dimitar.bogdanov
@dimitar.bogdanov 17 күн бұрын
It’s not clickbait. Someone unfamiliar with the event cycle might be completely confused by this, as it _looks_ broken, but isn’t.
@sleitnick1
@sleitnick1 17 күн бұрын
@@dimitar.bogdanov That's why I made this. I was quite confused at what was going on at first.
@bacon_208
@bacon_208 17 күн бұрын
if someone wasn't aware that task.wait() runs at heartbeat or at least summarised it as every other frame (because that's usually the context in which task.wait() is used) then this video is pretty valuable and straight to the point as well definitely not click bait. The title is obv trying to grab your attention because that's how the algorithm is but it proposes a question instead of a statement so it's not wrong
@vyntax.mp3
@vyntax.mp3 16 күн бұрын
​@@sleitnick1ignore the OP. Ive seen this guy hate on other developer youtubers like crusherfire.
Fixing Lua OOP
10:27
sleitnick
Рет қаралды 17 М.
but what is 'a lifetime?
12:20
leddoo
Рет қаралды 57 М.
Super sport🤯
00:15
Lexa_Merin
Рет қаралды 20 МЛН
Como ela fez isso? 😲
00:12
Los Wagners
Рет қаралды 28 МЛН
Functional Programming Introduction
21:22
sleitnick
Рет қаралды 14 М.
Roblox Task Library
5:49
sleitnick
Рет қаралды 4,4 М.
Object Oriented Programming in PICO-8
17:13
Kevin Makes Games
Рет қаралды 4,8 М.
Roblox Circuit Simulation Demo
12:32
sleitnick
Рет қаралды 2,7 М.
Why learn LUA?
6:24
Kodaps Academy
Рет қаралды 4,1 М.
WTF is "Zone.js" and is it making your app slow?
13:21
Joshua Morony
Рет қаралды 52 М.
Rust's Alien Data Types 👽 Box, Rc, Arc
11:54
Code to the Moon
Рет қаралды 132 М.
Ngzone in Angular - Improve Performance by Running Code Outside Angular
7:38
Monsterlessons Academy
Рет қаралды 6 М.
Type-Safe Navigation with the OFFICIAL Compose Navigation Library
10:03
STOP Watching Coding Tutorials Right Now! My LEARNING FRAMEWORK
12:19
Harkirat Singh
Рет қаралды 206 М.
Когда игра в танки зашла слишком далеко
0:12
Короче, новости
Рет қаралды 2,6 МЛН
дед пранканул маму киллера #роблокс #мем #анимация
0:43