Should I use UI system or make a UI feature in-game.

I want to make an “accuracy? bar”, not sure how it is called so I will explain. Imagine a simple, horizontal bar and there is a vertical line moving horizontally left to right. Inside the bar there is a zone and if the player stops the line inside the zone it gives extra points/speed/accuracy, whatever. Now the problem is that I want to use the UI system since its a UI feature. But I have no idea where to start figuring this out. Am I able to use raycasting on UI elements?
Ill appreciate any info on where to start.

Use the UI system. Learn how here: Learn game development w/ Unity | Courses & tutorials in game design, VR, AR, & Real-time 3D | Unity Learn