local player = game:GetService("Players").LocalPlayer
local UIS = game:GetService("UserInputService")
local char = script.Parent or player.CharacterAdded:Wait()
local hum = char:WaitForChild("Humanoid")
local RS = game:GetService("ReplicatedStorage")
local camera = workspace.CurrentCamera
local run = false
local animation = script:WaitForChild("Animation")
local loadedAnim = hum:LoadAnimation(animation)
local blocking = char:WaitForChild("Blocking")
local stamRemote = RS:WaitForChild("Remotes"):WaitForChild("Stamina")
UIS.InputBegan:Connect(function(input, gpe)
if input.KeyCode == Enum.KeyCode.LeftShift and blocking.Value == false then
hum.WalkSpeed = 20
run = true
stamRemote:FireServer("startedRun")
if hum.MoveDirection.Magnitude > 0 and run == true and char:WaitForChild("Stamina").Value > 1 then
camera.FieldOfView = 75
end
while run == true and char:WaitForChild("Stamina").Value > 1 do
run = true
wait()
end
hum.WalkSpeed = 10
loadedAnim:Stop()
run = false
if run == false then
hum.WalkSpeed = 10
end
end
end)
UIS.InputEnded:Connect(function(input, gpe)
if input.KeyCode == Enum.KeyCode.LeftShift and blocking.value == false then
run = false
stamRemote:FireServer("stoppedRun")
hum.WalkSpeed = 10
camera.FieldOfView = 70
end
end)
hum.Changed:Connect(function()
if hum.MoveDirection.Magnitude > 0 and run == true and char:WaitForChild("Stamina").Value > 1 then
camera.FieldOfView = 75
end
end)
camera:GetPropertyChangedSignal("FieldOfView"):Connect(function()
if camera.FieldOfView == 75 then
loadedAnim:Play()
elseif camera.FieldOfView == 70 then
loadedAnim:Stop()
end
end)
The game is made by me, the animation is published. And I’m running an animation with the animation id set to the published animation. And I don’t know why roblox is failing to load it, I’ve tried over a dozen of times, and same result.
It had nothing to do with the status of the animation. I think everybody knows how to properly publish animations at this point, also you don’t need to give the same answers as people already has in this thread.
The problem were my garbage code. Instead of calling GetPropertyChangedSignal() on the camera, I called it on the value I was trying to listen after instead, which obviously won’t work.
Is it the cam Prop change that made the animation stop in game? Like why make the anim run when the FOV change instead of making it below the line that change the FOV amount?