Dragging system bug

So a buddy of mine made a custom dragging script, where you click on an item and it attaches to your mouse. After placing a dragged item, the system breaks not allowing the user to select another item to drag.

Example:
https://gyazo.com/61a4fe2f5b81f70eb421d7f69487536e

Here’s the chunk of code that’s not working.
Code:
https://gyazo.com/1054ff002e1e277cd46d82ef9ab72ec1

Any suggestions on how to fix this?

1 Like

Do you have the code that sets currentlyDragging? You never reset the variable when the item has been placed (I’m not sure if you’re checking before setting)

currentlyDragging is set inside of this chunk.

https://gyazo.com/db6f259e381211fcbff9861fe0dc5e0c

Yeah, you’re checking if currentlyDragging is already set before changing it. As you never reset it it’ll only work once. You can fix this by simply adding currentlyDragging = nil when you place the frame

1 Like

Thank you!

1 Like