i want to get this material inside a script i was writing
Material mat = cloudMesh.GetComponent < Material > ();
and it say’s :
MissingComponentException: There is no ‘Material’ attached to the “CloudSystem” game object, but a script is trying to access it.
You probably need to add a Material to the game object “CloudSystem”. Or your script needs to check if the component is attached before using it.
UnityEngine.Material.SetTexture (System.String propertyName, UnityEngine.Texture texture) (at C:/buildslave/unity/build/artifacts/generated/common/runtime/ShaderBindings.gen.cs:231)
UnityEngine.Material.set_mainTexture (UnityEngine.Texture value) (at C:/buildslave/unity/build/artifacts/generated/common/runtime/ShaderBindings.gen.cs:185)
ManagerScript.Start () (at Assets/SpiderGame/Script/StartLevel/ManagerScript.cs:31)