Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Making a boat cross the lake by an animation with a click detector. Why is it not working?

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

0

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

1 answer

maybe your game is set to "r15" and the animation is "r6" or maybe the other way around please check :D

This discussion is preserved as it was. New answers, comments, and votes are closed.