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

How do I change the walk animation if the player walks or not?

Asked by 5 years ago

I am creating a gun and I am wondering, how can I change the walking animation of it when I walk, and stop the animation when I am no longer walking. I tried using HumanoidStateType but that wont work since I cant detect if player stops. Only if he runs/walks.

I tried this:

local walk = gun.Humanoid:LoadAnimation(game.ReplicatedStorage.WeaponModules.Deagle.Animations.Walk)
local hum = game.Players.LocalPlayer.Character.Humanoid

if hum.WalkSpeed == 16 then
    walk:Play()
end
if hum.WalkSpeed == 0 then
    walk:Stop()
end

but the animation wont stop even if I am not moving and my speed is 0. Sorry, I just never messed with it so I have no ideas how to make this.

Any help please?

0
maybe just overwriting the default animations could work, change the animations in the "Animate" script in the player model fanofpixels 718 — 5y
0
I actually already found a solution, and no. I am using a view model thats inside my Camera. It has a different animation. It doesnt have a "default" animation, like robloxian does. Thanks anyway :) HeyItzDanniee 252 — 5y

Answer this question