-
What do you want to achieve?
When the user inputs a mouseButton1 click, the animation plays. -
What is the issue?
It returns the error:LoadAnimation requires an Animation object - Client - LocalScript:9
. The animation is infact an animation object. -
What solutions have you tried so far?
Nothing. I couldn’t find anything on this topic that EXACTLY matched my error.
local inputService = game:GetService("UserInputService")
local anim = game:GetService("ReplicatedStorage"):WaitForChild("SlapANIM")
inputService.InputBegan:Connect(function(inp, _gameProc)
if inp.UserInputType == Enum.UserInputType.MouseButton1 then
local plr = game.Players.LocalPlayer
--make the user play the animation anim
print(anim.ClassName)
plr.Character.Humanoid:LoadAnimation(anim):Play()
end
end)
Things to note
- When I print the ClassName it says it’s a KeyFrameSequence which I don’t know if that means it is an animation or not. I don’t want to use a animation link.