When I press a key an animation should play, but it is not playing. I know it’s working because I have the “KeyframeReached” event, and the stuff inside the function is running after some time.
So basically, the animation is running, but I can’t see it? or it isn’t loading? I don’t know
The script:
local char = plr.Character or plr.CharacterAdded:Wait()
local hum = char:WaitForChild("Humanoid")
local hrp = char:WaitForChild("HumanoidRootPart")
local deathBeamAnim = hum:LoadAnimation(animations.DeathBeamAnim)
deathBeamAnim.Priority = Enum.AnimationPriority.Action
deathBeamAnim:Play()
Make sure the humanoid is the right humanoid and also check if the animation itself is even working (Open it in animation editor or whatever), sometimes animations are blank.
Have you tried using this script? Also don’t leave in the “variable” part.
local variable1 = script:WaitForChild(“Animation”)
local variable2 = script.Parent:WaitForChild(“Humanoid”)
local variable3 = thisdude:LoadAnimation(variable1)
variable3:Play()
Also make sure to put an animation into the script and put your animation ID in the animation.
Sorry if i typed something wrong because im not on pc test it this might work without remote event
local player = game.players.LocalPlayer or game.Players.PlayerAdded:Wait()
local character = player.Character or player.CharacterAdded:wait()
local humanoid = character:WaitForChild("humanoid")
local anim = Instance.new("Animation")
local anim.AnimationId = "rbxassetid:// " --your animation id here
local track = humanoid:LoadAnimation(anim)
local uis = game:GetService("UserInputService")
function onKeyPressed(InputObject)
if InputObject.KeyCode == Enum.KeyCode.Q then
track:play
end
end
uis.InputBegun:Connect(onKeyPressed)