Weld CFraming Help

Hi everyone!
I’m currently working on a vr game. Because of that, I added attributes to every item you can pick up. I have two attributes: WeldRotation and WeldOffset, both of which are Vector3s. I’ve been making games for three years but I still got stuck on this part :rofl: : since you can’t the position and orientation of a weld’s C1 and C0 directly, how would I go about setting the orientation and offset? Here’s what I currently have, which doesn’t get the position or orientation correct:

-- orientation is the item's WeldRotation attribute
Main.C1 = CFrame.Angles(rad(orientation.X), rad(orientation.Y), rad(orientation.Z))*CFrame.new(item:GetAttribute("WeldOffset"))
-- the orientation part works fine by itself but the weldoffset messes it up

Any help would be appreciated!

Maybe try switching the order of the CFrames? (Weld offset goes first, angle second)

I don’t that that’ll do anything because the commutative property should still apply here where offset * rotation = rotation * offset

Well Motor6Ds are an offset value… this means that they are in local space; you’ll have to convert whatever this orientation variable you have into local space/object space and then apply the angles

I’ve already got that. I just need help applying it to the Motor6D because you can’t set those directly.
image
image

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.