#animation failed to load
17 messages · Page 1 of 1 (latest)
local function playAnimation()
local character = game.Players.LocalPlayer.Character
local humanoid = character and character:FindFirstChild("Humanoid")
if humanoid then
local animator = humanoid:FindFirstChildOfClass("Animator")
if animator then
local animation = script.Animation
animator:LoadAnimation(animation):Play()
end
end
end
local function onKeyPress(input)
if input.KeyCode == Enum.KeyCode.E then
playAnimation()
end
end
game:GetService("UserInputService").InputBegan:Connect(onKeyPress)
its a local script inside the starterplayerscripts
@ocean osprey
💀
your going to have to wait for the character to load when it comes to being inside starter player scripts
so how to fix it?
you are trying to index a nil value because the local script runs way too fast and the character does not have the chance to load itself
replace that ^ with local Character = game.Players.LocalPlayer.CharacterAdded:Wait()
dude
rn the animation is not even playing
i dont see the error
what is wrong rn?
still not working