Basically, I’m Making a Battleship Gun, The Gun consists of 2 Parts
A Canon and an inner Part (Both of Them are welded Together using a WeldConstraint)
and The Canon Part Rotates, But when it rotates, it Rotates itself, and The inner Part with
So is There is a Simple Way To Rotate The Canon Without Effecting The inner Part?
I’m going to assume since you provided no code that you’re rotating a part orientation, rotate the actual weld object’s C0 or C1 using CFrame.Angles instead.
You’re gonna have to use a normal Weld so you can adjust the C1 property to get the desired affect, WeldConstraints aren’t that good for applications where one part can rotate. Or you could use a Motor and utilize its properties related to Angles
Provide the code then. By using Motor6Ds and changing the C0 and C1 CFrame its a good approach, make sure that the base part of the turret has enough Mass too.
Would be better if you show your code, otherwise we’re just “guessing”
local ConnectionUp = nil
local ConnectionDown = nil
game.ReplicatedStorage:WaitForChild("RotateUp").OnServerEvent:Connect(function(player)
local Rotators = CollectionService:GetTagged("Rotators")
ConnectionUp = game:GetService("RunService").Heartbeat:Connect(function()
for _,Rotator:Part in pairs(Rotators) do
local Weld = Rotator:FindFirstChildOfClass("Motor6D")
Weld.C1 = Rotator.CFrame * CFrame.Angles(math.rad(0.3),0,0)
end
end)
end)
game.ReplicatedStorage:WaitForChild("RotateDown").OnServerEvent:Connect(function(player)
local Rotators = CollectionService:GetTagged("Rotators")
ConnectionDown = game:GetService("RunService").Heartbeat:Connect(function()
for _,Rotator:Part in pairs(Rotators) do
local Weld = Rotator:FindFirstChildOfClass("Motor6D")
Weld.C1 = Rotator.CFrame * CFrame.Angles(math.rad(-0.3),0,0)
end
end)
end)
game.ReplicatedStorage:WaitForChild("DisableUp").OnServerEvent:Connect(function(player)
local Rotators = CollectionService:GetTagged("Rotators")
ConnectionUp:Disconnect()
end)
game.ReplicatedStorage:WaitForChild("DisableDown").OnServerEvent:Connect(function(player)
local Rotators = CollectionService:GetTagged("Rotators")
ConnectionDown:Disconnect()
end)