So, I’m having a simple issue where the knife model I weld to a characters right hand is facing upside down, I tried using C0 of the weld to set the rotation of the part 180 degrees but it does not work. How would you use C0/C1 to change how the weld rotates the knife.
‘’’
local equip_knife = function(right_arm,damage)
local knife = rp.Attacks.Knife_Part:Clone()
local cf = right_arm.CFrame
local weld = right_arm.RightGrip
knife.Damage.Value = damage
knife.Creator.Value = right_arm.Parent.Name
knife.Parent = right_arm
weld.Part1 = knife
end
‘’’
try
weld.C0 = CFrame.new(X,Y,Z) * CFrame.Angles(0,math.rad(0),0)
CFrame.new(X,Y,Z) is known as moving your knife to Right/Left , Up/Down , Front/Back
CFrame.Angles(X,Y,Z) is known as rotate your knife to Right/Left , Up/Down, Front/Back
Note : math.Rad used for forced on a X, Y or Z to a wanted rotation because CFrame.Angles doesn’t works like normal rotate tools
That will offset the knife using the rotation as well. If you don’t understand what I mean, imagine a lever that’s 1 meter long and rotate it. Instead of rotating using its actual middle as its center, it will rotate around the bolt its connected with. If you want to avoid this, add a vector.
weld.C0 = CFrame.Angles(angles, go, here) + Vector3.new(offset, goes, here)
weld.C0 = weld.C0 * CFrame.Angles(0,math.rad(--[[Your number]]),0)
try this
That will only work if the weld’s C0 CFrame doesn’t already have an offset. Even though it might work, you’ll get weird tool positioning that’s hard to figure out why.
then
weld.C1 = weld.C1 * CFrame.Angles(0,math.rad(--[[Your number]]),0)
Same goes for C1. It might even add some complexity since you have to allign C0 and C1, which isn’t really a beginners topic.