for i,v in pairs(script.Parent.Parent:GetDescendants()) do
if v:IsA('BasePart') then
if v.Name ~= 'Engine' and v.Name ~= '1' then
local Weld = Instance.new('Weld')
Weld.Parent = v
Weld.Part0 = BayBlade['1']
Weld.Part1 = v
Weld.C0 = BayBlade.Engine.CFrame:Inverse() * v.CFrame
elseif v.Name == 'Engine' then
local SpinWeld = Instance.new('Weld', BayBlade.Engine)
SpinWeld.Part0 = BayBlade.Engine
SpinWeld.Part1 = BayBlade["1"]
SpinWeld.C0 = CFrame.new(0, -0.47, 0)
end
end
end
Above is the video of what happens.
Everything in the body is welded to a spin part and that part is welded to the “Engine” part.
Currently, the only part that spins is the “Engine” Part, which you can see in the video, I’m trying to have the rest of the parts welded to it to rotate as well.
Any help is appreciated!
I would recommend creating an anchored root part–a part that is stationary. You can then weld the engine to that root part, and update the C0 weld between the two to rotate the entire piece. You will have to change your welds to motors.
local weld = Instance.new("Motor")
weld.Part0 = a
weld.Part1 = b
weld.C0 = CFrame.new()
When you rotate the main motor, the CFrame change propagates to your engine, then to the rest of your visual parts.
If you cannot afford to anchor the parts, I would recommend welding to keep the parts first, then using a BodyGyro and a BodyAngularVelocity to hold the orientation of the item and to keep it spinning.