So I’m trying to create a Drag and Drop inventory system. It’s going well so far, but there is a problem when dragging the frame.
I want to make it so it drags from the position I clicked. However, the mouse just goes to the corner of it since I’m simply using this to set the position.
The only solution I can think of is setting the Anchor Point to my mouse position, but since it uses scale I’m not sure how to convert my mouse position offset into a percentage. I’m not even sure if changing the Anchor Point will fix it, so please tell me some other solutions. If you’re confused on what I’m trying to do here is an example:
You’ll see how no matter where the mouse is clicked, the frame moves with that position. But in mine, it moves from the corner no matter what.
It gets bigger because you are using the Scale property adjusted to the frame that the frame is a member of. Try reducing the size while it’s being dragged to avoid that enlargement, then change it back once dropped.
I’m assuming you are using a loop / render stepped for this. You can create an offset value by subtracting the mouses initial position by the frames first position. You can then apply this offset to the frames position everytime it is moved.