Sorry, They are return commands. I updated main post.
The functions is called to trigger particle effects in different moments, there are no loops in it.
The thing I really can’t explain is that if I change the conditions adding code like this
What is the MonoBehaviour that is starting the coroutine on? Coroutines will stop executing if the object they are called on is destroyed or set to inactive.
I think I had some response for this problem.
For how was structured my code if I didn’t set the object to null, after calling the coroutine, further calls would have entered the first condition. The effect played anyway because I forgot to uncheck play on awake on the particle systems being instantiated.
I want to thank you so much for your precious time
The WaitToObj function is in the same script. It gets called right away.
My mistake was on the hierarchy conditions, since there wasn’t else if clause to avoid entering the others.
And, sorry, I simplified the code to avoid confusion. Thank you for your time too!