Hello, everyone! I have been working on making a custom character and would like to know how to make an animation script so that the animations will play depending on if he is walking, climbing, etc. Thank you!
I got it to work! I had done something wrong with my rig, but I just re-rigged it and did what @HugeCoolboy2007 said to!
1 Like
You could copy and paste the default roblox animation script into your rig and change the animation ids.
It will be auto-inserted into your character when you play test, it’s a localscript named ‘Animate,’ just copy it, end the session, paste it and change it to a server script. Though there is a small section in the script that you will have to remove because it works client only.
1 Like
What is the section I need to delete?
It’s near the bottom of the script, it’ll have game:GetService("Players").LocalPlayer
: remove that and function that’s connected to it
it’s not working. Any idea what I did wrong?
Did you place it inside the character rig? If so, the character rig has to be a similar model to a roblox character, (HumanoidRootPart, Humanoid, Head, UpperTorso) etc.
Yes, it is inside the character rig and I used all the same body parts as normal roblox character.
Is anything anchored inside of it?
I don’t think so. The character will walk around, but it just won’t play the animation.
When I put it in the workspace, it will play the animations, but not when I put it in the starter player.
Make a server script and put it in server script service.
The script:
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
wait(3)
char.Animate.idle.Animation1.AnimationId = "rbxassetid://YOUR ANIM ID"
char.Animate.walk.WalkAnim.AnimationId = "rbxassetid://YOUR ANIM ID"
char.Animate.run.RunAnim.AnimationId = "rbxassetid://YOUR ANIM ID"
end)
end)
you can change climbing, falling etc. anims too.
1 Like
This didn’t work. Any ideas what I did wrong?
I accidentally added that line of code where it changes humanoid walkspeed. Did you put in the correct animation ID’s?
I copied them from my animations I made.
Are the animations published on the account your in? Because it doesn’t work if its published in a other account.
Yes, they are published on this account.
Can you post the animation script?
Do I take a picture of it and post it?
A screenshot or copy and paste. If your doing copy and paste put it in a code block like this: