Gui or texture (ex. circle) on plane by click

Hi there!

I have character who is been moving by ClickToMove script and i searched around the web and pretty much on Unity Answers and doc. And i couldn’t find anything that works for me.

So, i wanna create ar circle (2d texture or some simple black point - dont care)… leave a mark on clicked position, when player moves to position the circle disapears…

I dont want to someone code the script for me, but i would be very happy to give me some direction to look at. LineRenderer i think wouldn’t be the right thing or just i have no idea how to use it in this situation, also tried projector - no success.

Ideal for my case would be : click > show texture > character reach destination > remove texture. The thing is - I dont know how to show that texture on plane.
Can someone suggest something for me?

Perfect would be c# example.

Thanks. Sorry about english

Rather than using a texture, you might be better off using either a projector or a mesh, and placing them so they’re just above the ground. To get where the user clicked in C#, you’d do this in its Update() function:

public Transform indicator;

public void Update() {
    if (Input.GetMouseButtonDown(0)) {
        const float offset = 0.1f; //set this to whatever offset from the surface you want
        Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
        RaycastHit hit;
        if (Physics.Raycast(ray,out hit, Mathf.Infinity)) {
            indicator.position = hit.point + hit.normal * offset;
            
            //alternatively, offset it upwards, depending on what you want
            //indicator.position = hit.point + Vector3.up * offset;
        }
    }
}

Then for the indicator, you’d just need to, say, show it when it’s beyond some distance from the player.