Hey, so i’m having a problem where I can’t seem to find a way to turn a part’s position and orientation into a weld’s C0 position/orientation. This might sound confusing but let me explain. I have part1 that is attached to a weld as C0, I want to move that C0’s offset into the same position as part2 (I ONLY WANT TO MOVE THE C0’S OFFSET, NOT PART1’S POSITION, if that makes any sense…) Can someone help me out?
1 Like
local motor = script.Parent
local target = workspace.Target
local function worldCFrameRotationToC0ObjectSpace(motor6DJoint,worldCFrame)
local part1CF = motor6DJoint.Part1.CFrame
local part0 = motor6DJoint.Part0
local c1Store = motor6DJoint.C1
local c0Store = motor6DJoint.C0
local relativeToPart0 = part0.CFrame:inverse() * worldCFrame * c1Store
local goalC0CFrame = relativeToPart0
return goalC0CFrame
end
while true do
task.wait()
motor.C0 = worldCFrameRotationToC0ObjectSpace(motor, target.CFrame)
end
2 Likes
The weld automatically destroys itself once I try to move either one of the parts.
just set C0 to nil and move the part, then set C0 again?
Nevermind! I was doing something completely wrong.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.