I wanted to make a object move to a target when mouse is clicked how would i do this

void setup(){

void draw(){
rect(100, 200, 40, 40);
rect(400, 400, 40, 40);

A point that follows the mouse put this in mouseClicked()
or you can look at this and adapt it to waht you need (put this inside mouseClicked() too)

1 Like