Draw a line to a new pontential character position/target

Need to draw a line like in a strategy game where you select a unit, object and where you want it to move or which target you want it to attack, think hearthstone

You can use Raycast to draw in front of camera, using mouse position.
Input,mouse position as same as input.gettouch(0).phase
For that you should use “Plane” draw use not use box or any other game object |

Same as we use a ball and drage it on to the screen. and it spread a line behind it. As where the mouse is touching the object is following the position.
The USe a component “Trail render” and then where your mouse will go the same line will draw as same point on screen. As in strategy games it happens.