Texture from script not showing up

Hey guys!

I have a problem that’s been bugging me for days. I have a script that’s supposed to take in a texture, and make a new texture using threshold values (the new texture should just be black and white).

But during playmode it just shows up white, that is until I click on the texture (on the material of the gameobject) and change anything in the Inspector. Then it shows up just fine.

I’ve tried to make those changes in the last part of the script, but it doesn’t change anything. I HAVE to go into the inspector while in Play-mode and either change the aniso level or filter mode by hand. Anyone know what could be wrong?

Pic 1: When entering Play-mode
Pic 2: After changing anything in the new script-made texture while in playmode

Could you try to call EditorApplication.SaveAssets() after modifying your texture?