I'm trying to do a thing where I can pick up an object and drag it somewhere else and the code I'm using is basically start with a variable on -1, set it to 1 when I click, set it to 0 when I release, and setting it to 0 does some fancy stuff then automatically sets it back to -1. I've made it so that when the variable = 1 the object sets its position to Mouse.X Mouse.Y. All of this is working, but something really weird is happening with the last bit. When I click on it, instead of setting its position to my where my cursor is it sets it a set distance to the right, but even weirder, if I move my main character left (all this stuff is part of a pause menu) so that the main character's X value gets closer to 0, the change is less significant. If my main character's X value is 0 there is no problem.
So is there anything I should check my code for that might be causing this issue? Thanks!