I need the animation "Kick" to play when a button is clicked, and im using a remote event to make the script in starter character scripts play animation, but it gives me an error of "unable to cast value to Object" on line 4??
local char = script.Parent
local event = game.ReplicatedStorage.RemoteEvents.StartAnimation
local AnimationTrack = game.StarterGui.ClickGUI.Main.Kick
local Animation = char.Humanoid:LoadAnimation(AnimationTrack.AnimationId)
event.OnServerEvent:Connect(function(player)
if player.Name == char.Name then
Animation:Play()
end
end)
The event is being called from a localscript that works just fine
