So I have a userinputservice going on in my script
and I tried to set a
InputObject:GetPropertyChangedSignal("Position")
Apparently this works perfectly fine on Mobile
But when it comes to desktop it fires once which is when the Input has ended
Does anyone know why this is?
Heres my code
ImageButton.InputBegan:Connect(function(InputObject)
if InputObject.UserInputType == Enum.UserInputType.MouseButton1 or InputObject.UserInputType == Enum.UserInputType.Touch then
InputObject:GetPropertyChangedSignal("Position"):Connect(function()
print('Mouse has moved')
end)
end
end)
To be honest this code does work on Desktop too but the printing seems to stack meaning the events are stacking
which is a memory leak?
Anyone know whats going on?

9 comments
I have already tried this but the problem I am facing right now is that this script will not fire the position event for some reason unlike mobile and I still don't know why but it just wont fire them as they are being dragged for some reason the event seems to fire only when the Input is ended
Not only that when you wrap the event inside of the condition that its either gotta be a MouseButton1 or Touch it starts doing that however when it is outside of the condition it does not do that do you know why this is happening to me?
im pretty sure ContextActionService is better at handling TouchInputs and Keyboard input aswell as gamepad inputs
and you can try to get mouse postion on screen when clicked basically the same thing
Or when the mouse moves
Is contextactionservice good for GUI's I have always thought of contextactionservice as something other than GUIS like weapons or creating buttons systematically
Also there is no input changed event specifically made for context action service which I had to use MouseMovement and Enum.UserInputType.Touch for that and you know Input Changed is probably better than listing those two since there could be other input changed events
Also I have noticed ContextActionService performs poorly with GUI's Input Began like the context action dosen't detect the input began on the gui so like smh
cant you just detect when clicked then Track the mouse Position and stop when ContextActionService ObjectState changed to end??