How do i move objects by holding mouse key?

Hey im new into babylon. I come from unity where every object i create has an update function which triggers update every frame only for that object which allows me to check for mouse button hold and move object towards cursor while mouse button is held.

Is there equivalent method in babylon? As far as i saw there is mouse hold and mouse up, but the thing i want to achieve is movement similar to Diablo like games. while button is held → move to target, and stop moving if button is up.

hey. Thanks for response but thats not exactly what i mean

I want to make my object (for ex. box) start moving towards cursor position while holding mouse key and stop moving when i release mouse key up.