I tried to upload the videos on the Devforum but I received error messages so instead, I posted them on YouTube
The blue part’s orientation must match the red part’s orientation on the red and blue axis only. The blue part’s green axis must be left untouched.
To make sure my question is clear, here’s a video that shows the desired behavior of the blue part: https://www.youtube.com/watch?v=XRUQH9Lw8rY
Now let’s see what I get.
Everything works perfectly when I’m trying to rotate the part on all 3 axis, as you can see here: https://www.youtube.com/watch?v=bD_p5ES_3xs
But when I try to ignore the green axis, the blue part becomes corrupted when it tries to rotate after the red part’s red or blue axis!
You can view this bug here: https://www.youtube.com/watch?v=r9Hg6K8sjfs
How do I fix that?
This is my current code:
(Part0 is the red part and Part1 is the blue part)
game:GetService("RunService").RenderStepped:Connect(function()
local rv = workspace.Part0.CFrame.RightVector
local uv = workspace.Part0.CFrame.UpVector
local bv = -workspace.Part0.CFrame.LookVector
local rv1 = workspace.Part1.CFrame.RightVector
local uv1 = workspace.Part1.CFrame.UpVector
local bv1 = -workspace.Part1.CFrame.LookVector
workspace.Part1.CFrame = CFrame.new(6, 9, -25, rv1.X, uv1.X, bv1.X, rv.Y, uv.Y, bv.Y, rv1.Z, uv1.Z, bv1.Z)
end)