#Strafing is breaking our custom animations

1 messages · Page 1 of 1 (latest)

thick gust
#

We using custom animations in our game and we added the strafing feature for cleaner sideways movement, but right now it's ruining the walk animation. When strafing is off our animations work fine...

#

Here is our scripts:

local module = {}

function module.change_animations(character, animation_ids)
    local humanoid = character:WaitForChild("Humanoid")
    local animator = humanoid:WaitForChild("Animator")
    
    for _, playingTrack in animator:GetPlayingAnimationTracks() do
        playingTrack:Stop(0)
    end
    
    local animateScript = character:WaitForChild("Animate")
    animateScript.run.RunAnim.AnimationId = "rbxassetid://" .. tostring(animation_ids[1])
    animateScript.walk.WalkAnim.AnimationId = "rbxassetid://".. tostring(animation_ids[2])
    animateScript.jump.JumpAnim.AnimationId = "rbxassetid://".. tostring(animation_ids[3])
    animateScript.idle.Animation1.AnimationId = "rbxassetid://".. tostring(animation_ids[4])
    animateScript.fall.FallAnim.AnimationId = "rbxassetid://".. tostring(animation_ids[5])
    animateScript.swim.Swim.AnimationId = "rbxassetid://".. tostring(animation_ids[6])
    animateScript.swimidle.SwimIdle.AnimationId = "rbxassetid://".. tostring(animation_ids[7])
    animateScript.climb.ClimbAnim.AnimationId = "rbxassetid://".. tostring(animation_ids[8])
end

return module
#
local Players = game:GetService("Players")
local module = require(script.Parent)

local default_animations = {
    74488323962877, --run
    74488323962877, --walk
    116237683954342, --jump
    123986310739575, --idle
    81350111717674, --fall
    10921138209, --swim
    10921139478, --swim (idle)
    124277883276921 --climb
}

local function onPlayerAdded(player)
    player.CharacterAppearanceLoaded:Connect(function()
        local character = player.Character
        
        module.change_animations(character, default_animations)
    end)
end

Players.PlayerAdded:Connect(onPlayerAdded)
blissful heart
#

I would honestly scrap that old Animate script

#

it's really bad

ornate hearth
#

I don’t think you can use custom animations with strafing