So I’ve rigged a viewmodel and I’m trying to load an animation that I made with that specific model.
Here is the code:
local char = script.Parent
local vmodel = workspace.CurrentCamera:FindFirstChild(char.Name.."_VMODEL")
local vhum = vmodel:WaitForChild("Humanoid")
local hum = char:WaitForChild("Humanoid")
local WalkAnimID = 9289981604
hum:GetPropertyChangedSignal("MoveDirection"):Connect(function()
if hum.MoveDirection.Magnitude ~= 0 then
if hum.WalkSpeed == 16 then
vhum:LoadAnimation(WalkAnimID):Play()
end
end
end)
And here is how the viewmodel looks inside the explorer:
(I have tried to use an animation object aswell)