Line Rendering for 2D Connect the Dots Game

Hi I’m new to Unity and have a question about restricting the player’s ability to draw lines while playing this game.

My 2D game involves the player drawing lines between pairs of dots in a grid of provided dots. I only want the player to be able to draw lines between two dots but no where else on the screen.

I’ve made the dots into game objects and added circle colliders to them so I could use OnMouseDown() in the Dots script, to enable my DrawLines script that allows the player to draw lines with the 2D line renderer when Unity detects the player has clicked on a dot. I’ve got the line rendering down but still the player can also draw anywhere else on the screen :frowning: (I think my problem is that I can’t visualize when and in which script to disable the DrawLines script.)

How can I restrict the player’s line drawing only from dot to dot?

Has anyone of you by any chance done the first procedure please … @Brullix3000 , @magister_yoda_ and @zsolti .

Player clicks dot1
Linerenderer is created (Goes from dot1 to mouse)
player moves mouse to dot2 (line follows)
player clicks dot2
line snapps to dot2