Like this:
One of your main problems is you can’t use a delay on tick. It just generates a new delay line every frame which, if you think about it, amounts to having no delay at all…