Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I properly use Vector3.FromNormalId()?

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

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)

2 comments

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?

0

I don't, sorry.

This discussion is preserved as it was. New answers, comments, and votes are closed.