spritekit – Unable to execute attack animation

I am building a game in Swift using SpriteKit and GamePlayKit. I have built joystick and the players character can move with animation depending upon its orientation.

However, when I try calling (when pressing the attack button) the animation for attack – it never gets played. What am I doing wrong?

switch(AttackDirection)

    
    {


    case .ST:
    SpeedX = 0
    SpeedY = 0
        if AttackDirection != LastDirection {

            removeAction(forKey: "Attack")

            if LastDirection == Direction.E
            {
            self.texture = SKTexture(imageNamed:"AttackRight1")
        }
            if LastDirection == Direction.W
            {
            self.texture = SKTexture(imageNamed:"AttackLeft1")
        }
            
            if LastDirection == Direction.S
            {
            self.texture = SKTexture(imageNamed:"AttackFront1")
        }
            
            if LastDirection == Direction.N
            {
            self.texture = SKTexture(imageNamed:"AttackBack1")
        }
       

        }

        LastDirection = AttackDirection

        
    case .E:
    SpeedX = SP
    SpeedY = 0
        if AttackDirection != LastDirection
        
        {

            
        let MoveAtlas = SKTextureAtlas(named:"Sprites")
        var MoveFrame = (SKTexture)()
        for i in 1...MoveAtlas.textureNames.count / 2
        
        {
            
            let TextureName = "Right" + "(i)"
            print(TextureName)
            MoveFrame.append(MoveAtlas.textureNamed(TextureName))
            
        }
        
        let MoveAnimationAction = SKAction.repeatForever(SKAction.animate(with:MoveFrame, timePerFrame: 0.125))
        self.run(MoveAnimationAction, withKey: "Attack")

        }
        LastDirection = AttackDirection
        
    case .W:
    SpeedX = -SP
    SpeedY = 0
    
        
        if AttackDirection != LastDirection
        
        {

            
        let MoveAtlas = SKTextureAtlas(named:"Sprites")
        var MoveFrame = (SKTexture)()
        for i in 1...MoveAtlas.textureNames.count / 2
        
        {
            
            let TextureName = "AttackLeft" + "(i)"
            print(TextureName)
            MoveFrame.append(MoveAtlas.textureNamed(TextureName))
            
        }
        
        let MoveAnimationAction = SKAction.repeatForever(SKAction.animate(with:MoveFrame, timePerFrame: 0.125))
        self.run(MoveAnimationAction, withKey: "Attack")

        }
        LastDirection = AttackDirection
        
        
        
    case .S:
    SpeedX = 0
    SpeedY = -SP
        if AttackDirection != LastDirection
        
        {

            
        let MoveAtlas = SKTextureAtlas(named:"Sprites")
        var MoveFrame = (SKTexture)()
        for i in 1...MoveAtlas.textureNames.count / 2
        
        {
            
            let TextureName = "AttackFront" + "(i)"
            print(TextureName)
            MoveFrame.append(MoveAtlas.textureNamed(TextureName))
            
        }
        
        let MoveAnimationAction = SKAction.repeatForever(SKAction.animate(with:MoveFrame, timePerFrame: 0.125))
        self.run(MoveAnimationAction, withKey: "Attack")

        }
        LastDirection = AttackDirection
        
        
    
    case .N:
    SpeedX = 0
    SpeedY = SP
        
        if AttackDirection != LastDirection
        
        {

            
        let MoveAtlas = SKTextureAtlas(named:"Sprites")
        var MoveFrame = (SKTexture)()
        for i in 1...MoveAtlas.textureNames.count / 2
        
        {
            
            let TextureName = "AttackBack" + "(i)"
            print(TextureName)
            MoveFrame.append(MoveAtlas.textureNamed(TextureName))
            
        }
        
        let MoveAnimationAction = SKAction.repeatForever(SKAction.animate(with:MoveFrame, timePerFrame: 0.125))
        self.run(MoveAnimationAction, withKey: "Attack")

        }
        LastDirection = AttackDirection

        
    
    }
    self.position = CGPoint(x:position.x + SpeedX, y: self.position.y + SpeedY)
}
}