FromNormalId How do i use it?

  1. What do you want to achieve? I want to know how to use Vector3.FromNormalId their arent any tutorials, and no code samples on the dev wiki.

  2. What is the issue? When I try to use it with what I think might work it errors. I need this mainly because I’m trying to recreate a gravitational pull from planets to create orbit.

  3. What solutions have you tried so far? I’ve looked on the dev wiki and searched on google and looked here, no help no topics no answers.

Vector3.FromNormalId is just a way to create unit basis vectors. For example, Vector3.FromNormalId(Enum.NormalId.Top) is equivalent to, 1, 0).


Oh, is there a way i could make it calculate the vector3 needed to move to a part?

1 Like

Which direction do you want to move the part?

Not in any specific direction. just towards a part that could be anywhere in space.

To get the direction vector between two positions, you can simply subtract the source position from the destination position:

local directionVector = (destinationPart.Position - sourcePart.Position).unit

Alr thanks ill try that now, hope it works

1 Like

When i use it, i get this result not it moving to the part, im not sure if i didnt understand you correctly or i done something wrong

sourcePart should be the moon, destinationPart should be the planet if you are trying to move the moon towards the planet. Or are you trying to make the moon orbit the planet?

I just need the vector that will move the moon to the earth i have all the other math done and yes the first position is moon and second position is earth

(moon.Position - earth.Position).unit

Please read my response carefully, sourcePart should be moon and destinationPart should be planet, so what you want is

(earth.Position - moon.Position).unit

Oh just flipped it works now. alr let me get the rest of this code working with that, thanks!

NP, please mark a response as a solution if it closes your original question :smiley: