Hective
|
  |
| Joined: 30 Jan 2012 |
| Total Posts: 176 |
|
|
| 08 Jun 2017 10:23 AM |
| In scripting language, how would I print the absolute position of where my cursor is every time it's position changes? |
|
|
| Report Abuse |
|
|
|
| 08 Jun 2017 10:30 AM |
What type of position?
Where the cursor clicks or the cursor Gui's position? |
|
|
| Report Abuse |
|
|
K7Q
|
  |
| Joined: 23 Mar 2013 |
| Total Posts: 5546 |
|
|
| 08 Jun 2017 10:35 AM |
| 2D, on your screen position. |
|
|
| Report Abuse |
|
|
|
| 08 Jun 2017 10:36 AM |
local mouse = game.Players.LocalPlayer:GetMouse()
while wait() do print(mouse.X) print(mouse.Y) end |
|
|
| Report Abuse |
|
|
Hective
|
  |
| Joined: 30 Jan 2012 |
| Total Posts: 176 |
|
|
| 08 Jun 2017 11:08 AM |
| Thank you. And how would I compare multiple sets of positions to see which one is relatively closer to a certain point? |
|
|
| Report Abuse |
|
|
Hective
|
  |
| Joined: 30 Jan 2012 |
| Total Posts: 176 |
|
| |
|
KLGA
|
  |
| Joined: 19 Apr 2014 |
| Total Posts: 2571 |
|
|
| 08 Jun 2017 12:44 PM |
| distance between ### ###### is known as magnitude if you're using Vector3 or Vector2 values than roblox has built in a way to get it by doing Vector.magnitude if not, magnitude is calculated by taking the square root of all the values (x,y,z,etc) squared, added together: sqrt(x^2 + y^2) compare two positions by subtracting the first magnitude from the second |
|
|
| Report Abuse |
|
|
KLGA
|
  |
| Joined: 19 Apr 2014 |
| Total Posts: 2571 |
|
|
| 08 Jun 2017 12:45 PM |
distance between two seperate locations is known as magnitude
if you're using Vector3 or Vector2 values than roblox has built in a way to get it by doing Vector.magnitude
if not, magnitude is calculated by taking the square root of all the values (x,y,z,etc) squared, added together:
sqrt(x^2 + y^2)
compare two positions by subtracting the first magnitude from the second |
|
|
| Report Abuse |
|
|