[Solved] Create a Line From Object to dynamic Mouse Position

I’m making a simple control where you touch and pull to throw something (not swipe).
I can’t seem to figure out how to draw a line starting from the touch down position to my current dynamic mouse position.
It should simply look like a slingshot with 1 line.

Here’s how it looks, with player as the cursor.

1 Like

First create a shape painter object. Then open the events tab and make a new event. Click on add action then scroll down until you find primitive drawing. Click this, click on drawing and then select line. Select the shape painter object in the first box. then for the x position of start point put yourobjectname.X(). Do the same for the y position replacing the X() with Y().
then, for the end point put MouseX(, ) and MouseY(,). Set the thickness to whatever you want. Then, for the condition of the event put mouse button pressed or touch held. now, whenever you touch a touch screen or click with a mouse it should draw a line between the object and your finger or cursor. Hope this helps :slight_smile:


Thanks for the very detailed comment :sweat_smile:
I actually thought that using this action would create instances of the shape painter object so I was finding something like set endpoint :rofl: