How can I get the Position of a part relative to a part?

Hello, so I’m making a build checking system but for that I need to get the Position of a part relative to another part.

Could somebody please help me?

Thank you for helping.

I’ll need more context than that to answer your question. What is the situation that you’re encountering? What do you mean getting the position of a part relative to a part?

Yes, I need to get the position of a part relative to another part.

You still didn’t give any context.

you can use ToObjectSpace() if you’re dealing with CFrame, but with normal Vector3’s you can use basic subtraction between them.
(If i assume that you mean one point is the origin)

1 Like

In other words:

To get the CFrame in object space:

local objectCFrame = part.CFrame:ToObjectSpace(otherPart.CFrame)

To convert back to world space:

local worldCFrame = part.CFrame:ToWorldSpace(objectCFrame)

More information about CFrames:

Oh thank you so much! Have a nice day!
My eyes skipped them bc i was tired.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.