HatHelper
|
  |
 |
| Joined: 02 Mar 2009 |
| Total Posts: 46305 |
|
|
| 25 Jan 2012 04:39 PM |
| I have three parts. Part A is the center of one place, and part B is close to it. How would I figure out how far part B is from part A, and move it the same distance from part C, based on the ray |
|
|
| Report Abuse |
|
|
| 25 Jan 2012 04:43 PM |
Well... I don't know how you would do part C, but I know the formula to get distance would just be:
local X, Y, Z = A.Position.X, A.Position.Y, A.Position.Z local X2, Y2, Z2 = B.Position.X, B.Position.Y, B.Position.Z local Distance = math.sqrt( (X^2 + X2^2) + (Y^2 + Y2^2) + (Z^2 + Z2^2) )
「TheNewScripter」 |
|
|
| Report Abuse |
|
HatHelper
|
  |
 |
| Joined: 02 Mar 2009 |
| Total Posts: 46305 |
|
|
| 25 Jan 2012 04:44 PM |
Or just .magnitude. What good is code |
|
|
| Report Abuse |
|