My Animation don't play

Hi my names is Pixeluted and I want do if player click animation play with knifeattack animation but Animation don’t play I using remotefunction I sending Animation to script and want play it
Local Script In tool

local Tool = script.Parent
local CanHurt = script.Parent.CanHurt
local Animation = script.Parent:WaitForChild("KnifeAttack1")
Tool.Activated:Connect(function()
	game.ReplicatedStorage.PlayAnimation:InvokeServer(Animation)
end)

Script in ServerScriptService

game.ReplicatedStorage.PlayAnimation.OnServerInvoke = function(player,Animation)
	local Loaded = player.Character.Humanoid:LoadAnimation(Animation)
	Loaded:Play()
end

Thank for Read

Player Animations are automatically replicated, so you do not need a RemoteFunction to play them.

Try directly playing the Animation in your LocalScript when the Tool is equipped.

1 Like

Sir If I do in local script then Only player see animation nobody others

If you play an Animation for a Player in a LocalScript it will replicate to everyone, Try it in a Local Server with 2 Players.

I fixed it I dont set in game Player Be R6 Character thats why don’t play

Alright, the RemoteFunction is still not necessary and I invite you to do it directly in the LocalScript, it will still work and it’s not hard to do either.

I personally recommend that you run the animation on the client just as @dcampeon said.

There will be no delay from client to server and run the animation seamlessly.

1 Like

As some people have said above, you don’t need the server to play animations. They will replicate to everyone in a local script. Also try checking what the animation priority is set to, making it an action will override anything. Another reason could be you have to be the one that makes the animation even though that doesn’t seem to be the problem here, it is still good to know. Finally as you said your character is an R6, make sure your animation will work properly for your character.

1 Like