Hi I made some arms that follow your mouse, and I want an idle animation to play but it doesn’t play
Local script for arms in scs:
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local camera = workspace.CurrentCamera
local plr = Players.LocalPlayer
local char = plr.Character
local mouse = plr:GetMouse()
local humanoid = char:WaitForChild("Humanoid")
local HumanoidRootPart = char:WaitForChild("HumanoidRootPart")
local CameraPos = char:FindFirstChild("CameraPos")
local armOffset = char.HumanoidRootPart.CFrame:Inverse() * char["Right Arm"].CFrame + Vector3.new(0, 0, -.75)
local armOffset2 = char.HumanoidRootPart.CFrame:Inverse() * char["Left Arm"].CFrame + Vector3.new(0, 0, -.75)
local armWeld = Instance.new("Motor6D")
armWeld.Part0 = char.HumanoidRootPart
armWeld.Part1 = char["Right Arm"]
armWeld.Parent = char
local armWeld2 = Instance.new("Motor6D")
armWeld2.Part0 = char.HumanoidRootPart
armWeld2.Part1 = char["Left Arm"]
armWeld2.Parent = char
RunService.Heartbeat:Connect(function()
camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = CameraPos.CFrame
local cframe = CFrame.new(char.HumanoidRootPart.Position, mouse.Hit.Position) * CFrame.Angles(math.pi/2, 0, 0)
armWeld.C0 = armOffset * char.HumanoidRootPart.CFrame:toObjectSpace(cframe)
local cframe2 = CFrame.new(char.HumanoidRootPart.Position, mouse.Hit.Position) * CFrame.Angles(math.pi/2, 0, 0)
armWeld2.C0 = armOffset2 * char.HumanoidRootPart.CFrame:toObjectSpace(cframe2)
end)
Video:
Sorry i’ve posted alot of questions/topics i am really struggling with this.