I need help
My viewmodel works but I can’t get it to sway.
https://gyazo.com/877357556e8bd9af07ebdaef926d8cb1
I have tried offsetting the camera but the viewmodel just follows the camera.
local enabled = false
script.Parent.Equipped:Connect(function()
game.ReplicatedStorage.v_Template.Parent = game.Workspace.CurrentCamera
local idle = Instance.new("Animation")
idle.AnimationId = "rbxassetid://6059835776"
ianimate = game.Workspace.CurrentCamera.v_Template.Animation:LoadAnimation(idle)
enabled = true
ianimate:Play()
game:GetService("RunService").RenderStepped:Connect(function()
if enabled then
game.Workspace.CurrentCamera.v_Template.HumanoidRootPart.CFrame = game.Workspace.CurrentCamera.CFrame
end
end)
end)
script.Parent.Unequipped:Connect(function()
enabled = false
ianimate:Stop()
game.Workspace.CurrentCamera.v_Template.Parent = game.ReplicatedStorage
end)