How to draw debug arrow on top?

I found a solution, but I had to make changes to the function in C++. I added the solution in an answer.