Getting position straight out from part

I want to figure out the position straight out from one side of the part by n studs with any orientation. Here’s an image to explain it better:

I essentially want to know how I can get the position n studs out from the red arrow. Any help is greatly appreciated.

ig this will help you out…

local NstudsPos = script.Parent.Position.Y + Vector3.new(0, n, 0)
1 Like

Assuming You Mean Just the Position itself, do this:

local Part1 = workspace.YourPart1
local Part2 = workspace.YourPart2
print(Part1.Position)
print(Part2.Position)

--To get a Specific Coordinate, Do this:

print(Part1.Position.X)
print(Part2.Position.Y)

Assuming You Mean Distance, do this:

local Part1 = workspace.YourPart1
local Part2 = workspace.YourPart2

local Magnitude = (Part1.Position - Part2.Position).Magnitude
print(Magnitude)

Sorry for the misunderstanding, but I meant getting the position of Part2 without Part2 being there.

Copy the Position of Part2 and do this:

P2Pos = Vector3.new(Your Parts Position)

So you mean that if you rotate the yellow part, the red part will follow the rotation?

red_position = (yellow_cframe * CFrame.new(n, 0, 0)).Position

where n is how many studs away it is. If it’s the wrong direction, make n negative or swap the n and one of the 0s.

I’m not trying to make a new part or position one at all, that was an example. I am trying to get what the position of that part would be if it did exist.

Getting Position Straight out from Part

You may need to be more specific then

I wan’t to figure this value out, but no matter what the orientation is.