generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Getting the absolute position of my cursor?

Previous Thread :: Next Thread 
Hective is not online. 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
ExpensiveGaming is not online. ExpensiveGaming
Joined: 01 Apr 2013
Total Posts: 783
08 Jun 2017 10:30 AM
What type of position?

Where the cursor clicks or the cursor Gui's position?
Report Abuse
K7Q is not online. K7Q
Joined: 23 Mar 2013
Total Posts: 5546
08 Jun 2017 10:35 AM
2D, on your screen position.
Report Abuse
SwagCuzYolo is not online. SwagCuzYolo
Joined: 31 Oct 2013
Total Posts: 1224
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 is not online. 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 is not online. Hective
Joined: 30 Jan 2012
Total Posts: 176
08 Jun 2017 11:51 AM
Bump
Report Abuse
KLGA is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image