How to use OnMouseDrag as a coroutine

Hi, I’ve read in the manual that OnMouseDrag and OnMouseUp: “can be a co-routine, simply use the yield statement in the function”. but when I try to do it (like yield return new WaitForSeconds(.1f); or just yield return null) I get an error:

error CS1624: The body of …OnMouseDrag()’ cannot be an iterator block because `void’ is not an iterator interface type.

Do I have to modify the function declaration in some way to use it as a coroutine? I tried to change void for IEnumerator but I get an error, so I’m not sure if I’m doing it right…

Anyway, I’m very new to programming, so any advice will be greatly appreciated.

Never mind, I double checked and I had missed typing “using System.Collections;”. Why do I remember having it there?..