My question is quite simple, I was recently play-testing my game and the output is suddenly spammed with this error:
14:58:08.503 - cannot resume dead coroutine 14:58:08.504 - Stack Begin 14:58:08.505 - Stack End 14:58:08.506 - cannot resume dead coroutine 14:58:08.506 - Stack Begin 14:58:08.507 - Stack End 14:58:08.508 - cannot resume dead coroutine 14:58:08.509 - Stack Begin 14:58:08.509 - Stack End 14:58:08.513 - cannot resume dead coroutine 14:58:08.513 - Stack Begin 14:58:08.514 - Stack End 14:58:08.519 - cannot resume dead coroutine 14:58:08.520 - Stack Begin 14:58:08.520 - Stack End
Before you say anything, I know what the error means and I have a general idea of where the error is coming from, as it happens when I fire a certain weapon so I am not asking for help on how troubleshoot. And that's the whole problem - I shouldn't have to "guess and check" when it comes to locating an error. Its location should be clearly defined and that's what I am failing to see. Am I missing something here or is this an intended feature? Thanks for your time in advance.
Edit:
I did some further experimentation with coroutines, and apparently the following code causes the same error, but for some strange reason it is not consistent with what I am experiencing because it actually returns the line of code causing the error:
local Test = coroutine.wrap(function() print(1) end) Test() Test()
The first Test()
obviously returns 1 in the output, while the second one produces the previous error but also includes the location:
16:16:00.822 - Workspace.Script:5: cannot resume dead coroutine 16:16:00.824 - Stack Begin 16:16:00.825 - Script 'Workspace.Script', Line 5 16:16:00.826 - Stack End