Detecting draggable object position change

I have draggable objects in my game and i need to detect if they have moved to another position. How would I tackle that?

If X position of Object is not Variable(oldx) or Y position of Object is not Variable(oldy) {
  Do Something
Set variable oldx to Object.X()
Set variable oldy to Object.Y()
1 Like