How to get a drawn line to snap into a shape?
Hi All
I am currently working on a series of small kids games one of which is a connect-the-dots game. The current iteration has a series of numbered dots (buttons) on the screen that, when clicked in the right order, reveal the line segment between those two dots. In the background I am simply switching background images after each dot is clicked. Each image has one more part completed than the previous.
After getting some feedback from play testers (two 5 year olds), it has become apparent that the instinct is to 'draw' the lines between the dots rather than push the buttons in series.
I want to let the player be able to draw their own lines between the dots (and it should curve as if they were drawing the line in MsPaint). This alone is relatively easy, the only issue is that it looks really bad.
Ideally (this is the part I'm asking for help with) I would like to have them draw a line between the correct dots, then have this line 'lerp' into the place of the correct line. i.e. if the line is meant to have a curve on it and the player draws a straight line, I would like to take that straight line and 'bend' it into place. This way, as the player connects all the dots, the 'correct' lines will take the places of their own lines and by the end of the game the image will look good.
Is there some kind of function where I could feed both the start and end line into it and have it morph between the two?
Barring this, could anyone advice me on a good way to 'hide' the transition if I have to swop between the player's line and the correct line? I was thinking maybe a VFX puff of smoke to hide the swop.
Thanks in advance.