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: Is this possible?

Previous Thread :: Next Thread 
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
13 Jul 2013 01:00 PM
How would i get the distance between two parts without using any methods, .magnitude OR a a ray?

This is something i don't have to know, just wondering...
Report Abuse
darknightofVorhan is not online. darknightofVorhan
Joined: 23 Jun 2008
Total Posts: 667
13 Jul 2013 01:05 PM
This is an Algebra 1 topic extended into 3D. Here:

--Distance = the square root of (change in x squared + change in y squared + change in z squared)

local function Distance(part1, part2)
local p1 = part1.Position
local p2 = part2.Position
return math.sqrt((p1.X - p2.X)^2 + (p1.Y - p2.Y)^2 + (p1.Z-p1.Z)^2)
end
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
13 Jul 2013 01:06 PM
Isn't that the formula roblox uses on .magnitude?
Report Abuse
darknightofVorhan is not online. darknightofVorhan
Joined: 23 Jun 2008
Total Posts: 667
13 Jul 2013 01:17 PM
Yup
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
13 Jul 2013 01:18 PM
Oh, okay. Thx.
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