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

How would I animate a viewmodel for my game?

Asked by 3 years ago
-- Module
function module.PlayAnimation(modelToAnimate, animToPlay, looped)

    print("called to play animation "..animToPlay.Name.." for the "..modelToAnimate.Name)

    local anim =modelToAnimate.AnimationController:LoadAnimation(animToPlay)
    anim.Looped = looped
    anim:Play()

end
-- LocalScript
    local gunToAnimate = GunAnimations:WaitForChild(weapon)
    local AnnoyingThingThatJustMakesMeMad = GunModels:WaitForChild(weapon)
    WeaponData.PlayAnimation(AnnoyingThingThatJustMakesMeMad, gunToAnimate.idle , true)

this is what i've tried

for context, weapon is a string, for example "pistol".

this is my first time posting here i have no idea

Answer this question