I made the turtles follow the mouse but I wanted to make the turtles follow at a distance . How do I do that?
You can do setxy (mouse-xcor + 1) (mouse-ycor +1) to make it stay a bit further from the mouse.
Try something like this:
ask turtles [
if (distancexy mouse-xcor mouse-ycor) > 4 [
facexy mouse-xcor mouse-ycor
right random 180 ; a bit of random variation helps
left random 180 ; the turtles separate from each other
You can use facexy (mouse-xcor) (mouse-ycor + 1)