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

How to change default swimming animation?

When you want to change a default swimming animation we all know that in order to do that we have to copy the animate script and paste it into StarterCharacterScripts. But in doing that for some reason I'm missing the "swim part" of the script:

With Swim(Friends shows)

Without Swim

If anyone can help me by how to add the swim part into the animate script that would be very much appreciated. Thank you

Regards, Bl_ueHistory

3 answers

✓ Accepted answer

After copying the Animate script, go back into the game and copy the swimming parts you need. Paste it into the Animate script in StarterCharacterScripts and voila. If this doesn't work, there's a more complex method requiring HumanoidStates. I'll walk you through that if all else fails.

4 comments

0

Where is the "swimming Parts"

0

I meant the swimming parts of the script, and the (probably) StringValues.

0

You can also probably just copy your friend's Animate script. I'm not sure why yours has no swim.

0

Thanks, I just copied my friends.

Looks like you don’t need to replace the Animate script entirely, according to the wiki page concerning this, you simply change the AnimationId's value created for the target animation. You will have to refer to the Default Animation Reference prompt to see what the animation is named, here swim.Swim.


local function onCharacterAdded(character)
	local humanoid = character:WaitForChild("Humanoid")
 
	for _, playingTracks in pairs(humanoid:GetPlayingAnimationTracks()) do
		playingTracks:Stop(0)
	end
 
	local animateScript = character:WaitForChild("Animate")
	animateScript.swim.Swim.AnimationId = "rbxassetid://123456789"
end
 
local function onPlayerAdded(player)
	player.CharacterAppearanceLoaded:Connect(onCharacterAdded)
end
 
Players.PlayerAdded:Connect(onPlayerAdded)

1 comment

0

Dude, What your script does(Which it has a lot of errors in such as "game".Player.PlayerAdded:Connect(PlayerAdded) Changes the Id of swim. When In my problem I state that I don't have the SWIM anim inside animate. Read carefully next time :/

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