#How do I Make My FPS Viewmodel Play an Anim when i walk

27 messages · Page 1 of 1 (latest)

thorny mica
#

I've tried practically everything i know, the rig is fine, it just doesnt play an animation if i walk if anyone could help itd be deeply appreciated

#

Is the "If humanoid.MoveDirection.Magnitude > 0 then" the correct way to do this also

thorny mica
#

ive tried this

#

also wont work

deep crow
#

where is your viewmodel?

#

do you mean like a fake pair of arms that the player sees whilst in first person?

thorny mica
#

Y3W

#

yes

#

also it is called M1 Garand

#

Im not sure theres anything incorrect about the script

#

oh damn it doesnt upload like a real video

#

practically all it does is sit in the same spot

thorny mica
#

or do you mean the actual way it looks

flint ivy
#

make it play once (make the animation looped also, with priority to movement)

thorny mica
thorny mica
#

I have no clue how i would debounce that

#

ive never done anything animation related

#

so this is a first

thorny mica
#

@flint ivy would you possibly know how to do that?

#

because im confused on how id use debounce to only play it once

flint ivy
flint ivy
# thorny mica <@399932631510286347> would you possibly know how to do that?
        local RunService = game:GetService("RunService")
        
        local anim = Instance.new("Animation") -- your anim or whatever
        local hum = Instance.new("Humanoid") -- your hum or whatever
        
        local playing = false
        
        RunService.RenderStepped:Connect(function()
            if hum.MoveDirection.Magnitude > 3 and playing == false then
                playing = true
                anim:Play(0)
            elseif playing == true and hum.MoveDirection.Magnitude <= 3 then
                playing = false
                anim:Stop(0)
            end
        end)
#

basic example