title: Sprite Kit create animated object
body: <p>I have the following code to create the animated texture:</p>
  
  <pre><code>-(void) setUpActions {
      SKTextureAtlas * atlas = [SKTextureAtlas atlasNamed:@"player"];
  
      // Running player animation
      SKTexture * runTexture1 = [atlas textureNamed:@"player1.png"];
      SKTexture * runTexture2 = [atlas textureNamed:@"player2.png"];
      SKTexture * runTexture3 = [atlas textureNamed:@"player3.png"];
      SKTexture * runTexture4 = [atlas textureNamed:@"player4.png"];
      SKTexture * runTexture5 = [atlas textureNamed:@"player5.png"];
      SKTexture * runTexture6 = [atlas textureNamed:@"player6.png"];
      SKTexture * runTexture7 = [atlas textureNamed:@"player7.png"];
      SKTexture * runTexture8 = [atlas textureNamed:@"player8.png"];
  
      NSArray * runTexture = @[runTexture1, runTexture2, runTexture3, runTexture4, runTexture5, runTexture6, runTexture7, runTexture8];
  
      runAnimation = [SKAction animateWithTextures:runTexture timePerFrame:0.06 resize:YES restore:NO];
  
      SKSpriteNode * playerNode = (SKSpriteNode *)[self childNodeWithName:@"player"];
      [playerNode runAction:[SKAction repeatActionForever:runAnimation]];
  }
  </code></pre>
  
  <p>And this creates the sprite node and is added to the scene in another method:</p>
  
  <pre><code>-(SKSpriteNode *)createPlayer {
      SKSpriteNode *player = [SKSpriteNode spriteNodeWithImageNamed:@"player"];
      player.position = CGPointMake(100, 160);
      player.name = @"player";
      player.zPosition = 100;
  
      return player;
  }
  </code></pre>
  
  <p>Doing it this way, I'm forced to create an object that has a static image and overwrite it with the animated texture. How do I create an object that is animated without it having a default static image?</p>