Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
3

How would I make an idle animation? This is my first time scripting.

Asked by 5 years ago

This is my first time scripting and I would like to know how I could make an idle animation.

0
for a tool? User#23365 30 — 5y
0
no, just for when a character stops moving ihadsomemoney 10 — 5y
0
Sure, but if you do know please do tell ihadsomemoney 10 — 5y
0
I believe you could check the Humanoid.MoveDirection = 0,0,0. I'm not entirely sure though. Pojoto 329 — 5y
View all comments (2 more)
0
Sorry I misunderstood what you were trying to accomplish, I'd suggest trying pojoto's idea. MythicalShade 420 — 5y
0
Mythical, i tried that video's idea and my character didnt have an animation for anything, ill try Pokoto's idea right now. ihadsomemoney 10 — 5y

2 answers

Log in to vote
1
Answered by
Pojoto 329 Moderation Voter
5 years ago

I did some research, and I believe you can use GetPropertyChangedSignal on the character, which can detect if a specified property of the character has changed, i.e velocity.

I saw someone else say this before but you could detect if the character's velocity is less than a number, and if it is, play the animation.

player.Character.Torso:GetPropertyChangedSignal('Velocity'):Connect(function()
    if player.Character.Torso.Velocity < 5 then 

        -- play animation

    end
end)

Saw this off a devforum. (I hope I'm still allowed to post it?)

0
In what script would I put this in? Local, module, or Script? Sorry if I sound dumb. ihadsomemoney 10 — 5y
0
or Humanoid.Running:Connect(function(speed) end) hellmatic 1523 — 5y
0
Thank you for helping! I have it done. ihadsomemoney 10 — 5y
0
Yay! No problem! You should probably add some wait()'s in the script so the animation doesn't play every time the player stops moving, only when they stop moving for 20 seconds or something. Pojoto 329 — 5y
View all comments (3 more)
0
pojoto my idle animation is like the cartoony r15 animation, it's mainly supposed to be there. ihadsomemoney 10 — 5y
0
Also, how would i get these to save so that when i go in and out of game they're still there? ihadsomemoney 10 — 5y
0
Hmmm? I'm not quite sure I understand. This code will always run when a player's velocity is changed, there's no need to 'save' or anything. Pojoto 329 — 5y
Ad
Log in to vote
0
Answered by
chomboghai 2044 Moderation Voter Community Moderator
5 years ago
Edited 5 years ago

Edit the Animate script. You can do that by starting up a play solo game in studio, then going to your character model and opening up the localscript Animate. Copy and paste that script into StarterCharacterScripts.

Inside the script, there is a table animNames. Inside the table, the first element is an element with the key idle. The value is a table of tables. Each table is a table that consists of the properties id, which has the value of the asset id for the animation, and then another property weight which you can read more about here.

All you have to do is add a table to the list consisting of your roblox asset id and weight and you will automatically perform the animation randomly when your player is idle.

local animNames = {
    idle = {
            { id = "http://www.roblox.com/asset/?id=507766666", weight = 1 },
            { id = "http://www.roblox.com/asset/?id=507766951", weight = 1 },
            { id = "http://www.roblox.com/asset/?id=507766388", weight = 9 },
            { id = "YOUR ASSET ID", weight = yourWeight }
        },
    walk =  {
        -- rest of script

Hope this helps! :)

0
Thank you for helping me! ihadsomemoney 10 — 5y

Answer this question