So I have this problem involving CFrames and Welds.
So let’s say I weld these 2 parts together, arrow representing their direction/orientation. Part0 is the tall part and Part1 is the bottom part.
And if you know how welds work, they maintain their offset in CFrame.
Now what I want to know is the formula to set the C1 of the weld to make it so Part1 will always face a specific direction, regardless of Part0’s orientation.
Try making a Udim2.new for the one that you want to have the CFrame positioned. Also, you would have to make a certain property to scale the welds so it can stand up straight.
When C0 or C1 are changed, the CFrame of the root part of the assembly isn’t changed. You can make sure that part1 is the root part by anchoring it or making its RootPriority bigger than the RootPriority of part0.
local RunService = game:GetService("RunService")
local targetLookVector = part1.CFrame.LookVector
weld.C1 = CFrame.new()
while part:IsDescendantOf(workspace) do
local part1Pos = part1.Position
local targetCf = CFrame.new(part1Pos, part1Pos+targetLookVector)
weld.C0 = part0.CFrame:Inverse()*targetCf
RunService.Stepped:Wait()
end