Help converting a weld's C0 Rotation into the equivalent C1 Rotation

  1. What do you want to achieve? I need to convert an accessory weld’s c0 rotation into the equivalent c1 rotation, which can then be applied to the c1, leaving the c0 rotation blank.

  2. What is the issue? I have no idea how to do this, and the things I have read, I
    did not understand.

  3. What solutions have you tried so far? I’ve looked through some developer forum posts, but i’ll be fully honest, I don’t really understand them. I found something that could be of use but I was unsure how to apply it at all.

(If I did this post right), there’s an image of my accessory below, with the weld and the C0 of the weld that I need converted. Any and all help is greatly appreciated

1 Like

You mean, translate this, into this, so C0 Orientation becomes 0,0,0
And C1 is the one with the orientation?
image


Both are essentially the same, its just the opposite, if you have Y -90 on C0, just set the C1 orientation Y 90 negative to possitive.
But… Im wondering what happens with X and Z, Im gonna test it


I tried that but it ends up just doing this

Edit: I forgot to invert the values, however, even with inverting values it still doesn’t work properly.

Two extra notes: I have specialmesh accessories, not meshpart ones, and the accessory i used in the screenshot is this: Type-12 Scattershot - Roblox

Yeah I was wrong, it cant be done by just changing from positive to negative, but I tried this, and it works as expected, I forgot that Inverse exist…

Im sending the weld I want to shift its C0 and C1 to this function, and just Inverse the C0 and placing it into C1 and setting the C0 to 0, 0, 0

function InverseC0_C1(weld)
	weld.C1 = weld.C0:Inverse()
	weld.C0 = CFrame.new(0,0,0)
end
InverseC0_C1(workspace.Model:FindFirstChild("Weld"))

nevermind, yes its working xD

1 Like

The fixed rotation is working, however this breaks the positions of accessories. Is there a way to do it somehow without changing the position of the welds/accessories at all?

Screen Shot 2023-05-30 at 8.48.09 PM

Edit: I figured it out. Thank you so much!
Final code:

local Weld = accessory:FindFirstChildWhichIsA("Weld", true)
local InvertedC0 = Weld.C0:Inverse()
local OriginalC1 = Weld.C1 - Weld.C1.Position

Weld.C1 = ( (InvertedC0 - InvertedC0.Position) * OriginalC1 ) + Weld.C1.Position
Weld.C0 = CFrame.new(0,0,0) + Weld.C0.Position
1 Like

Oh, so you are changing all accessories in the character? swaping its C0 orientation to C1?

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