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

how to stop Humanoid walk animation when moving with CFrame and state is physics?

Asked by 3 years ago

I'm creating a minecart script that moves a player by adding a minecart as an accessory, which is moved with CFrame tweens. That's all working nicely, but how do I stop the player from doing a walking animation while moving in the minecart? It feels like putting a humanoid in "Physics" state should already stop that. I've also tried enabling PlatformStand, which doesn't work either. I don't have reason to include the code, because nothing is wrong with it. I'm simply asking, how do you stop a humanoid from running the walk/run animation at all, for a set period of time?

0
Take a look at PlatformStand. JoyfulPhoenix 139 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

Well what do you know, I found it out. For the sake of the internet and those after me, here is the solution for this problem. If you want to have the character in a state where it cannot move conventionally, but walking anims are still overriding when you change it's CFrame constantly, you'll have to force upon it an idle animation that is paused. Because most character animations override the idle animation, this state will be overridden immediately once the character is freed from this state. Here is the code, assuming the player is already defined:

idle = Player.Character.Humanoid:LoadAnimation(Player.Character.Animate.idle.Animation1)
idle:AdjustWeight(9) --This is the default idle weight
idle:Play()
idle:AdjustSpeed(0) --A speed of 0 pauses the animation

If you happen to stop by and this solution helps you, please give me upvotes ;>

0
For some reason, the scripthelpers code viewer is cutting off line 1. Be sure to view the source; it's Animation1 and the parentheses should be closed. Galvarino 25 — 3y
Ad

Answer this question