How to draw a line on HUD by using C++

How to draw a line on HUD by using C++

Do you use AHUD canvas, UMG or Slate?

Ok,i found the problem.Draw Line function which is for HUD can be only used in “Receive Draw HUD” event.It will not work in another place.