#whats the point of telling a task to go last with defer when you can just put it at the bottom of th
1 messages · Page 1 of 1 (latest)
deferring just means you schedule the thread to run on the next frame’s heartbeat. there are not many use cases (atleast that i can think of). one thing u can do with it is to avoid errors when requiring modules recursively (making modules that require each other). normally it will error if you require recursively but task.defer will stop this from happening. its not recommended tho as its bad practice (cyclic dependencies)
English pls
Lol
I am a beginner, I have no clue of the words you have just said.
well some
then dont worry about deferred threads rn u will not really use them they have very few use cases
kk
ty
for task.spawn() if I use it in a function does it tell that script to run (like if it was a loop) and also going down the lines of code to not wait for that loop to finish?
task.spawn will run code in a different “thread” (not really but dont worry about this rn). its basically splitting up code into a different script so that it doesnt slow down the main script. so if you need to run code in parallel instead of in serial then u can use task.spawn. you can also use them for performance reasons like for terrain generation or performance heavy tasks but you said you are beginner so dont worry about this too much either rn
if u still dont understand then search up “threads”
and how they work
kk
I understand threads
now
ty
** You are now Level 7! **