Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Set mouse position on screen?

Asked by
Mineloxer 187
6 years ago

Since you can read the mouse x and y but not change them, what method can you to change them?

0
You cannot do this. lukeb50 631 — 6y
0
It would be very hacky if this was possible ie a script to make a player buy a item ingame. So this will never be possible to code ingame. User#5423 17 — 6y
0
How do you guys think some games like Phantom Forces have recoil on there weapons? I only needed this for gun recoil. Mineloxer 187 — 6y
0
camera abnotaddable 920 — 6y
0
Ok thanks. Mineloxer 187 — 6y

1 answer

Log in to vote
1
Answered by 6 years ago

There is no way to actually set the position of the players mouse.
The only thing I can think of that you may or may not actually mean is:
1)Setting mouse as Locked in the center
2)if you actually want to check the mouse position there are ways to do this:
a)Mouse.Target:

if mouse.Target = workspace.Part then

end

b)Mouse.Hit:

Mouse.Hit.p
Mouse.Hit.X
Mouse.Hit.X.p
Mouse.Hit.Y
Mouse.Hit.Y.p
Mouse.Hit.Z
Mouse.Hit.Z.p
0
I just needed a method to make my guns have recoil, I am not really sure of anymore ways I can achieve this other than messing with the mouse position. Mineloxer 187 — 6y
0
thats to do with camera, not mouse abnotaddable 920 — 6y
Ad

Answer this question