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 » Scripting Helpers
Home Search
 

Re: Magnitude

Previous Thread :: Next Thread 
awas3 is not online. awas3
Joined: 24 Oct 2010
Total Posts: 2854
25 Jun 2012 03:01 PM
How would you use magnitude in scripting?
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
25 Jun 2012 03:03 PM
    function distanceBetween(a,b)
        return (a.Position-b.Position).magnitude
    end

    print(distanceBetween(workspace.nate890.Torso,workspace.SpawnLocation))
Report Abuse
su8 is not online. su8
Joined: 06 Mar 2009
Total Posts: 6334
25 Jun 2012 03:04 PM
And you should try to avoid using magnitude :PP
Report Abuse
blobbyblob is not online. blobbyblob
Joined: 29 Oct 2008
Total Posts: 12165
25 Jun 2012 03:05 PM
Why would you avoid using magnitude? :l
Report Abuse
awas3 is not online. awas3
Joined: 24 Oct 2010
Total Posts: 2854
25 Jun 2012 03:06 PM
I want to make an automatic door :p
Report Abuse
su8 is not online. su8
Joined: 06 Mar 2009
Total Posts: 6334
25 Jun 2012 03:19 PM
>Why would you avoid using magnitude? :l

Calculating magnitude is slow.
Report Abuse
blobbyblob is not online. blobbyblob
Joined: 29 Oct 2008
Total Posts: 12165
25 Jun 2012 03:20 PM
I'm pretty sure that any time you create a vector3 object, roblox pre-calculates magnitude. Not to mention that many square roots are held in memory to make calculations like this easier.
Report Abuse
su8 is not online. su8
Joined: 06 Mar 2009
Total Posts: 6334
25 Jun 2012 03:23 PM
It's slow k?
Report Abuse
slayer9365 is not online. slayer9365
Joined: 22 Oct 2007
Total Posts: 2312
25 Jun 2012 03:25 PM
I prefer cubes rather than circles :P
Report Abuse
awas3 is not online. awas3
Joined: 24 Oct 2010
Total Posts: 2854
25 Jun 2012 03:25 PM
k
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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