I have a rigged boat, i animated it to cross this lake, but the code doesn't work. I tried to make it where if the click detector has been clicked then it will play this animation. Here is the code. Also I have the animation parented to the boat itself. The animation player is parented to the click detector.
local clickdetector = script.Parent
local Animation = game.Workspace.idk.Boat.Animation
clickdetector.MouseClick:Connect(function(player)
local animator = Instance.new("Animator")
local animTrack = animator:LoadAnimation(Animation)
animator.Parent = player.Character:FindFirstChild("Humanoid")
animator.Looped = false
animTrack:Play()
end)

1 comment
but why do you put the animator in the character's humanoid?