- Home /
Question by
benfattino · Sep 05, 2013 at 10:29 AM ·
materialloadresources
load resources material
I try to load material from resources folder with script like this: I have a folder with material named like: TextName_x_y.
this.renderer.material = Resources.Load(TextName + Manager.SceneNumber.ToString() + "_" + FrameINT.ToString(), Material);
Unity give me this error:
InvalidCastException: Cannot cast from source type to destination type. PlayLoadMaterial.Awake () (at Assets/Libreria/Script/PlayLoadMaterial.js:17)
It is possible to do this?
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613113622im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Resources.Load doesn't load my materials 1 Answer
Material Resource will not load when Resources.Load is called 2 Answers
How do I get a list of filenames in a Resources folder? 6 Answers
C# Error when trying to load Texture at runtime 1 Answer
Resource.LoadAll not working in build (works in editor mode) 2 Answers