PixiJS Swap animation Textures not switching

25 Views Asked by At

Im struggling on modify the animated Sprite if you change textures for the first time it does work correctly but the next change will not update textures so stick on the same animation.


  const TEXTURES = []; //list of animated Sprite generate

  class Avatar{
      constructor(ressources){
          this.spawnUnSpawn; //Animation
      }

      Spawn(){
          this.spawnUnSpawn.animation.textures = TEXTURES.spawn.textures;
          this.spawnUnSpawn.animation.gotoAndPlay(0);
      }

      UnSpawn(){
          this.spawnUnSpawn.animation.textures = TEXTURES.unspawn.textures;
          this.spawnUnSpawn.animation.gotoAndPlay(0);
      }
  }

0

There are 0 best solutions below