Coroutine stops executing if raycast function returns true?

I’m having a strange problem with my weapon script. I use a coroutine to handle shooting, and I execute a raycast function within the coroutine. However, my coroutine only executes the lines after the raycast function of said function returns false.

Can someone shed some light on what I’m missing? Is there a problem with my logic? Have I misunderstood something about how coroutines work?

Edit: Figured out the issue. I’m not sure how to delete the thread. I hadn’t assigned some references, but the errors weren’t showing up in the console.

Generally we don’t want threads deleted. Every bit of accumulated knowledge may help someone. The mods usually only delete when it’s completely off-topic, and in this case it’s nice that you solved your issue and came back and gave us the tl;dr of what went wrong and how you fixed it! Somebody might benefit from that in the future!

Ah, I see. Thanks for letting me know.