I'm trying to make it where if you equip a slot, the items part will be cloned and welded onto you, as if you were wearing it. I've made a weld, defined Part1, and now I need it to rotate to its appropriate orientation from a Vector3 value. Instead, it returns an error that makes no sense to my understanding.
weld.Part1 = meshclone weld.Part1.CFrame = weld.Part1.CFrame * CFrame.Angles(accval.Rotation.Value)
Any help would be great.
The problem is that CFrame.Angles
has three number inputs and not a single Vector3
input.
weld.Part1 = meshclone weld.Part1.CFrame = weld.Part1.CFrame * CFrame.Angles(math.rad(accval.Rotation.Value.X),math.rad(accval.Rotation.Value.Y),math.rad(accval.Rotation.Value.Z))
Another thing to keep in mind is that CFrame.Angles
expects you to input the rotation in radians, where 360 degrees is equal to 2 Pi.
You can simply use math.rad
to convert degrees into radians.