Quick question on coroutines

If I try to create a coroutine inside a class, I get an error, “Function arguments expected near (”, eg this doesn’t work.

It seems to be because the name is inside a class and has a class name prefix and colon. I can get it to work if I point at a function which isnt in a class. How then can I define a coroutine within a class?



Try Test.Test1, its a whole formal lua feature of : vs . There are a few helpful topics on the wiki

Thank you, Jordan, that works

I was separately using a callback to a class, and that didn’t like the syntax Class:Function either. So I tried your solution without success, then found a suggestion here.

…which involved sending through a separate reference to the class as well as to the function

One day I’ll understand all of this - I hope.