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 |
|
|
|
| 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
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
|
| 13 Jul 2013 01:06 PM |
| Isn't that the formula roblox uses on .magnitude? |
|
|
| Report Abuse |
|
|
| |
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
| |
|