I’m trying to play an animation client-sided so that only the player can see it but the animation won’t run, no errors.
local Player = game.Players.LocalPlayer
local char = Player.Character or Player.CharacterAdded:Wait()
local uis = game:GetService("UserInputService")
uis.InputBegan:Connect(function(input, gpe)
if input.KeyCode == Enum.KeyCode.E and not gpe then
local humanoid = char:WaitForChild("Humanoid")
local animator = humanoid:FindFirstChildOfClass("Animator")
local anim = Instance.new("Animation")
anim.AnimationId = "rbxassetid://8800366627"
local track = animator:LoadAnimation(anim)
track.Looped = true
track:Play()
end
end)
If the animation is loaded onto a humanoid, other players will still see it, even on a local script.
And I would recommend loading and making the animations before the input began, so you just need to do track:Play() in the function
If the animation object is instanced locally the animation will only replicate locally, you are correct though, if the animation is instanced by the server but then the animation track is played locally the animation will still replicate to the server.