I’ve made animations many times before and they always worked and played, but for some reason it doesn’t work here. I do everything as usual. I take the animation:
saved it to roblox, and copied the id.
then created an animation and pasted the idi and pressed enter.
After that I inserted the following code into my local script in starterPlayer:
local UserInputService = game:GetService("UserInputService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local animationFolder = ReplicatedStorage:WaitForChild("Animations")
local player =game:GetService("Players").LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local animator = humanoid:WaitForChild("Animator")
local remote = ReplicatedStorage:WaitForChild("Events"):WaitForChild("EarthWallRemote")
local abilitySettings = require(ReplicatedStorage:WaitForChild("Modules"):WaitForChild("AbilitySettings"))
local debounce = false
UserInputService.InputBegan:Connect(function(input)
if input.KeyCode == abilitySettings.Abilities[1].key and not debounce then
debounce = true
local earthWallAnimation = animationFolder:FindFirstChild("EarthWallAnimation")
animator:LoadAnimation(earthWallAnimation):Play()
remote:FireServer()
print("Ability activated:", abilitySettings.Abilities[1].name)
wait(abilitySettings.Abilities[1].cooldown)
debounce = false
end
end)
but for some reason when I press the button there is no animation although everything else works. Why?
P.S. For the test I took another animation from my other game and it is also playable