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

How can I get the relative CFrame from another part?

Asked by 3 years ago
Edited 3 years ago

Hi

I have 2 parts:

https://imgur.com/a/CfH1cIo

I have P1 and P2 I want to get the relative CFrame from P1 to P2

so when I use

P2.CFrame = P2.CFrame * Relative

the part should be placed in P1 CFrame

I tried this

local Relative = P2.CFrame:Inverse() * P1.CFrame

P2.CFrame = P2.CFrame * Relative

but it seems to be messed up when I rotate one of the parts who could I fix that?

Thanks!

Answer this question