0
0
Unityframework~10 mins

Stopping coroutines in Unity - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to stop a coroutine named "myCoroutine".

Unity
StopCoroutine([1]);
Drag options to blanks, or click blank then click option'
AStartCoroutine
BInvoke
CmyCoroutine
DWaitForSeconds
Attempts:
3 left
💡 Hint
Common Mistakes
Using StartCoroutine instead of StopCoroutine
Passing a method name instead of the coroutine variable
2fill in blank
medium

Complete the code to stop all running coroutines in a MonoBehaviour.

Unity
this.[1]();
Drag options to blanks, or click blank then click option'
ACancelInvoke
BStopAllCoroutines
CInvokeRepeating
DStartCoroutine
Attempts:
3 left
💡 Hint
Common Mistakes
Using StartCoroutine instead of StopAllCoroutines
Trying to stop coroutines individually without references
3fill in blank
hard

Fix the error in stopping a coroutine started by a string method name.

Unity
StopCoroutine([1]);
Drag options to blanks, or click blank then click option'
A"MyCoroutine"
BMyCoroutine()
CStartCoroutine
Dnull
Attempts:
3 left
💡 Hint
Common Mistakes
Calling the method instead of passing its name as a string
Passing the coroutine variable instead of the string
4fill in blank
hard

Fill both blanks to start and then stop a coroutine stored in a variable.

Unity
Coroutine myCoroutine = [1](MyRoutine());
StopCoroutine([2]);
Drag options to blanks, or click blank then click option'
AStartCoroutine
BStopCoroutine
CmyCoroutine
DInvoke
Attempts:
3 left
💡 Hint
Common Mistakes
Trying to stop the coroutine by method name instead of variable
Using Invoke instead of StartCoroutine
5fill in blank
hard

Fill all three blanks to start a coroutine, stop it, and then start it again.

Unity
Coroutine [1] = [2](MyRoutine());
StopCoroutine([3]);
Drag options to blanks, or click blank then click option'
AmyCoroutine
BStartCoroutine
DStopCoroutine
Attempts:
3 left
💡 Hint
Common Mistakes
Using different variable names for starting and stopping
Using method names instead of variables to stop coroutine