JordanG Posted April 22, 2021 Share Posted April 22, 2021 I'm loading the assets before creating the Game and I store the loader in a context so that every class can use that scene loader. Th first time such a scene loads everything works fine, but when the next scene with those sprites come ack I get this error "Cannot read property 'uvsFloat32' of null". I want to preload those assets, because I don't want to reload these assets for every scene, because they are used very frequently, like the Player and UI those are in every game scene and I thought that the loading times would improve if I would load those once at the begin. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted April 22, 2021 Share Posted April 22, 2021 probably texture was DESTROYED and then used again. Please debug more, and make minimal example of how that happens Quote Link to comment Share on other sites More sharing options...
JordanG Posted April 23, 2021 Author Share Posted April 23, 2021 Even if I do: this._container.destroy({ children: false, texture: false, baseTexture: false}); Still the _uvs are gone after a reload of the scene. This is how I go to another Scene: async goTo(name: Scenes) { this.previousSceneIndex = this.currentSceneIndex; const goTo = name; if (goTo > this.scenes.length - 1 || goTo < 0 || this._loadingScene) return; this._loadingScene = true; const nextScene = await this.scenes[goTo](this); this.currentScene.destroy(); this.currentScene = nextScene; this.currentSceneIndex = goTo; this.stage.addChild(this.currentScene.container); this._loadingScene = false; } Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted April 23, 2021 Share Posted April 23, 2021 the only objct that dstroys its texture for sure is Text. Are you trying to reuse old text somehow? If not, then i dont know what else can go wrong, need more information. debug Quote Link to comment Share on other sites More sharing options...
JordanG Posted April 23, 2021 Author Share Posted April 23, 2021 Th errors come from the AnimatedSprite component and the Sprite. The text doesn't give any errors. I don't know which sprites don't work, because I can't debug that, but there are a lot of errors so I think all of the preloaded sprites Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.