+ 1
Hi everyone
why the cube is teleporting instead of moving? https://code.sololearn.com/Wg5Y7zf6a2lP/?ref=app
1 Answer
+ 4
you should move the rect during every frame with a speed variable that depends on the position and distance between your finger and the rect itself.
Better accomplished with vectors as you'll need both x, y components (direction) and magnitude (speed).