Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I properly use Vector3.FromNormalId()?

Asked by
ipiano 120
10 years ago

I'm trying to make a part that adjusts it's position to be a specific amount relative from a different part. Originally, I thought I would have to use CFrame.lookVector, but that didn't work for side to side and up and down deltas, only straight on the vector. So, now I'm trying to make three Vectors, based on the top, front, and right sides of the block and multiply those by my deltas like so:

local pos = focus.Position + (Vector3.FromNormalID(Enum.NormalId.Front)*deltaz) +(Vector3.FromNormalID(Enum.NormalId.Right)*deltax)+(Vector3.FromNormalID(Enum.NormalId.Top)*deltay)

However, I keep getting the error that FromNormalID is a nil value. What am I doing wrong? And, to follow up, how to I tell the game what part's top, right, and front sides to use?

1 answer

Log in to vote
1
Answered by 10 years ago

Try this. I think it is because the D in "ID" should not be capitalised.

local pos = focus.Position + (Vector3.FromNormalId(Enum.NormalId.Front)*deltaz) +(Vector3.FromNormalId(Enum.NormalId.Right)*deltax)+(Vector3.FromNormalId(Enum.NormalId.Top)*deltay)
0
Thanks, for some reason the IDE keeps saying that it should be capitalized. :P Do you by any chance know the answer to my second question? ipiano 120 — 10y
0
I don't, sorry. Spongocardo 1991 — 10y
Ad

Answer this question