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?

2 comments

0

maybe just overwriting the default animations could work, change the animations in the "Animate" script in the player model

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 :)