Stop draggable behavior until an action is performed

My object (body2) has a draggable behavior but I don’t want it to be draggable yet until I have attached a line from body1 to body2. I was thinking of solving this through boolean variable but I’m going circles. I would appreciate it if someone would share their idea on how to solve this. Thank you!