Hello, for my game, I was making water for the player to swim on. I made an animation, i tested it, and it works. It is set to loop. I made a script a child of the water brick, and this is what i added to it:
wait(1)
local swimming = Instance.new("Animation")
local player = game.Players.LocalPlayer.Character
swimming.AnimationId = "rbxassetid://729824035"
script.Parent.Touched:connect(function(anim)
player.Humanoid:LoadAnimation(swimming):Play()
if script.Parent.Touched == false then
player.Humanoid:LoadAnimation(swimming):Stop()
end
end)
I'm not sure if i did something incorrectly, but the animation does play when i am in the water, but does not stop when i get out of the water. I'm sort of new to combining scripts with animations. Any help will be appreciated! :)
