I'm trying to change the default running animation's ID for a running script, but when I change the run animation's ID (which is a walk one for when not running) to a running animation ID, the new animation only starts playing when I stop moving then move again. The animation doesn't change while it is playing and I couldn't find any way to force it to refresh without making it randomly glitch.
if you use the .jump in the humanoid you can refresh the character that way you can make it look smoother by making the jump power very low and removing the jump animation temporarily then setting them back to normal as shown
01 | local function jump() |
02 | --variables |
03 | local char = game:GetService( "Players" ).LocalPlayer.Character |
04 | local animate = char:WaitForChild( "Animate" ) |
05 | local jump = animate:FindFirstChild( "jump" ) |
06 | local jumpanim = jump:FindFirstChild( "JumpAnim" ) |
07 |
08 | jumpanim.AnimationId = "rbxassetid://" --remove the animation |
09 |
10 | char.Humanoid.JumpPower = 0.01 --changes jump power |
11 | char.Humanoid.Jump = true --makes the player jump |
12 | wait() |
13 | char.Humanoid.JumpPower = 50 --resets jump power |
14 | jumpanim.AnimationId = "rbxassetid://5742579549" --resets animation to normal (the id is my own not the default jump animation id) |
15 | end |
16 |
17 | spawn(jump) |