I’m trying to load an animation when a player presses the Key E however the animation doesn’t play and it doesn’t throw any errors.
local Character = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
local Camera = workspace.Camera
local UIS = game:GetService("UserInputService")
local KeyBind = "E"
local repstor = game:GetService("ReplicatedStorage")
local selectedScene
local animClone = repstor.Animations.anim:Clone()
animClone.Parent = Character
local anim = Character:WaitForChild("Humanoid"):WaitForChild("Animator"):LoadAnimation(animClone)
--- this section of the code doesn't matter
UIS.InputBegan:Connect(function(input,Chatting)
if Chatting then return end
if input.KeyCode == Enum.KeyCode[KeyBind] then
anim:Play()
end
end) ```