of     1   

halomaster141
#24475063Sunday, April 18, 2010 8:09 PM GMT

How do I weld two parts together while preserving their relative orientations (I already know how to use welds.)? For example, if I have part A and a rotated part B, how do I weld B to A so that both parts keep their positions AND orientations?
halomaster141
#24475903Sunday, April 18, 2010 8:23 PM GMT

Idea: cf = CFrame such that a.CFrame * cf = CFrame.new(a.Position) w.C0 = a.CFrame * cf * b.CFrame + b.Position - a.Position Would that work? And how do I find cf?
halomaster141
#24477992Sunday, April 18, 2010 8:56 PM GMT

Anyone?
GoldenUrg
#24485173Sunday, April 18, 2010 10:57 PM GMT

I played around with some welding. It doesn't seem to work as I'd expect. This can be solved: cf = CFrame such that a.CFrame * cf = CFrame.new(a.Position) b * cf = a cf = b:toObjectSpace( a ) I would expect a Weld that of an existing a and b to look like: w = Instance.new("Weld") w.Part0 = a w.Part1 = b w.C0 = b.CFrame:toObjectSpace( a.CFrame ) w.C1 = a.CFrame:toObjectSpace( b.CFrame ) w.Parent = Game.JointsService
GoldenUrg
#24486285Sunday, April 18, 2010 11:17 PM GMT

This explains a little bit better: http://wiki.roblox.com/index.php/Welds It seems that "b" is placed at A.CFrame * w.C0 * w.C1. So there's a great deal of flexibility in the choices for C0 and C1. This: w = Instance.new("Weld") w.Part0 = a w.Part1 = b w.C0 = a.CFrame:toObjectSpace( b.CFrame ) w.C1 = CFrame.new() w.Parent = Game.JointsService But also: w.C0 = a.CFrame:inverse() w.C1 = b.CFrame Because a:toObjectSpace(b) is a:inverse() * b

    of     1