Change mesh material instantaneously

I use SetMaterial in a very systematic fashion in my project (basically every mesh component gets it) and it’s not supposed to do that.

What may be happening is that the material isn’t compiled - if that’s the case you’ll be fine in a release game. But you should get the error only once.
The other possibility is that the material isn’t loaded, and there is no easy solution.

The best way to handle such a case is to use material instances. Set the parent material to your object, and then you can apply instances of that material instantly.