Do default parameters not work with coroutines?
This seems pretty straightforward: I define a coroutine like so:
public virtual IEnumerator dispense (Task taskOverride = null) {
...
But when I call it at runtime with no parameters, I get "Failed to call function dispense of class Unit_local. Calling function dispense with no parameters but the function requires 1." I can't find any online references to this problem. Does it have something to do with my default value being null?
How do you start your coroutine? I advise you to NOT call it using its name.
Your answer
![](https://koobas.hobune.stream/wayback/20220613030255im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Coroutine Error when Capturing 360 Video 0 Answers
Why Unity docs do not use New with WaitForSeconds and yield? 1 Answer
Smooth Forward Movement with a CoRoutine 1 Answer
Failing a UnityTest when a condition that's expect to change in given amount of time doesn't? 1 Answer
If a variable used by a coroutine is changed, will the coroutine know while it is running? 1 Answer