Hello guys, I am trying to make a Minigun tool, and I want to have its Barrel Spin while it is being fired. However, using CFrame to spin it breaks the tool and either removes the weld, causing it to fall off, or spins the entire tool. Is there any way I could rotate just the Barrel, while also keeping it with the rest of the tool?
Method 1:
Use a WeldConstraint https://developer.roblox.com/en-us/api-reference/class/WeldConstraint Using a WeldConstraint will keep the object welded even if u change the CFrame. You just have to define Part0 and Part1 of the WeldConstraint.
Method 2:
Directly manipulate the CFrame of the weld to keep it attached.
Weld.C0 = Weld.C0 * CFrame.Angles(0, 0, math.rad(45))