Help with mouse controls

Hi Guys,

I would like to be pointed in the right direction regarding mouse controls on rpg maker mz.

I want a picture to be in a static spot, and when I click and hold the mouse button down the picture moves in a horizontal line and gets to a designated spot while mouse button is pressed in and rests there.

However,
If the mouse button is released at anytime the picture retracts smoothly back to its original spot.

I have tried diffrent things but just a beginner.

Any help would be greatly appreciated

Thanks for that
Hi Guys,

I would like to be pointed in the right direction regarding mouse controls on rpg maker mz.

I want a picture to be in a static spot, and when I click and hold the mouse button down the picture moves in a horizontal line and gets to a designated spot while mouse button is pressed in and rests there.

However,
If the mouse button is released at anytime the picture retracts smoothly back to its original spot.

I have tried diffrent things but just a beginner.

Any help would be greatly appreciated

Thanks for that
There's a script for touch that's used for mouse clicks.
TouchInput.isTriggered()
Or
TouchInput.isPressed()

From there you would have to give the event a move route to move left or right (you just said "horizontal" but it needs to be defined). You could then use a parallel that checks if the event is at a location other than its starting point or end point, give it a move route to go back to the starting point.

Give the parallel event a switch activated by interacting with the moving event, and have the switch turn off if its at the starting point or destination so it doesn't run all the time.

Original thread: https://forums.rpgmakerweb.com/threads/help-with-mouse-controls.163005/