i want to attach a script from an array to an object.
i always get the error “Cannot convert ‘UnityEngine.Texture2d’ to ‘UnityEngine.Material’”
If you’re trying to convert a byte array to a Texture2D, you need to use LoadImage(), and then once you have a valid Texture2D, you use SetTexture() to load it into a Material.
I notice that your error msg says “Texture2d” instead of 2D. Could just be that you have the type defined wrong.
Teeleton
wow perfect!
So, could you place your while script here so we can learn something?