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 : 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
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