|
| 16 Jan 2012 07:14 PM |
Why won't this work? Output: magnitude is not a valid member, did you forget to capitalize the first letter?
if (Main.Position - v.Position).magnitude > Distance then |
|
|
| Report Abuse |
|
|
|
| 16 Jan 2012 07:26 PM |
| are they bothe Vector3 position? if not then i wont work... |
|
|
| Report Abuse |
|
|
TwoBoo
|
  |
| Joined: 08 Feb 2011 |
| Total Posts: 10790 |
|
|
| 16 Jan 2012 07:28 PM |
| The output said that?? o.e |
|
|
| Report Abuse |
|
|
|
| 16 Jan 2012 07:28 PM |
"Vector3 position"
That gave me the answer, as they are GUIs I must use Vector2.new().
Weird error though. |
|
|
| Report Abuse |
|
|
|
| 16 Jan 2012 07:29 PM |
@Boo
Yup, UFAIL2 told me about that error, but I wasn't paying much attention. :c |
|
|
| Report Abuse |
|
|
|
| 16 Jan 2012 07:31 PM |
just use a custom magnitude function (i belive this is right, correct me if im wrong):
function mag(v1,v2) return sqrt(v1.x*v2.x+v1.y*v2.y+v1.z*v2.z) end |
|
|
| Report Abuse |
|
|
|
| 16 Jan 2012 07:32 PM |
sorry, i made a huge mistake:
function mag(v) return sqrt(v.x^2+v.y^2+v.z^2) end |
|
|
| Report Abuse |
|
|
|
| 16 Jan 2012 07:33 PM |
I'm good with math, but too many numbers; I can't follow D:
I'd rather use built-in functions, though that is more impressive. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 16 Jan 2012 07:39 PM |
You are a better coder then me, so I'm guessing yes. |
|
|
| Report Abuse |
|
|
|
| 16 Jan 2012 07:47 PM |
I think you need a special magnitude function for Vector2, they might not have it (localscript needed i think):
function v2mag(v) return sqrt(v.AbsolutePosition.x^2+v.AbsolutePosition.y^2) end |
|
|
| Report Abuse |
|
|
blockoo
|
  |
| Joined: 08 Nov 2007 |
| Total Posts: 17202 |
|
|
| 16 Jan 2012 07:48 PM |
lolnoobs
Everyone knows magnitude works for Vector2's as well. |
|
|
| Report Abuse |
|
|
blockoo
|
  |
| Joined: 08 Nov 2007 |
| Total Posts: 17202 |
|
|
| 16 Jan 2012 07:49 PM |
Proof:
http://wiki.roblox.com/index.php/Vector2 |
|
|
| Report Abuse |
|
|
|
| 16 Jan 2012 07:50 PM |
| I never to bother actually checking wiki T_T |
|
|
| Report Abuse |
|
|