[SOLVED] How to solve 'Attempting to use a texture that has been destroyed'?


After the operation of the project, there will be an error, but it is not clear where the error occurs, and how to solve it.
Who can help me?

Hi @leooooooo,

What are you trying to do and you are getting that error?

I’m trying to preload some asset that I get this error.btw,I solve this error,thx :slight_smile:

If you can provide a public, small project that reproduces this error, it will help people investigate/look into it.

you could try adding this to Initialize of some script, and looking at the log:

pc.Tracing.set(pc.TRACEID_TEXTURE_ALLOC, true);
pc.Tracing.stack = true;

ideally use the preview engine for this, so version 1.58.0, as the `.stack’ part of this is ignored on the previous version

The reason is that I unload the material during initialization

okay,I’ll try it next time