Replies: 1 comment
-
I found the answer for those interested:
Lua function: function wait(t)
t = t or 0;
for i = 0, t do
coroutine.yield();
end;
end; |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Long story short, I tried making my own wait function using
lua_yield
and a task scheduler. In short, the main thread will pcall the loaded luau chunks and if the execution result was LUA_YIELD, I add the thread/lua substate to the task scheduler, and it callslua_resume
on them next frame. However, whenever I calllua_yield
, it throws the attempt to yield across C-boundary error. Is there a better way to do this?My wait function:
Beta Was this translation helpful? Give feedback.
All reactions