Fadestars.cs(18,29): error CS0103: The name `MyRenderer' does not exist in the current context

Trying to fade in a stars material thats on a cube, so over time, it seems like u go into space

Fadestars.cs(18,29): error CS0103: The name `MyRenderer’ does not exist in the current context

using UnityEngine;
using System.Collections;

public class Fadestars : MonoBehaviour {
	

		// TRIGGER AUDIO MISSLESHOT

		public float FadeTime = 13f;

		void Start (){
			MyRenderer = GetComponent<Renderer>();
		}



		void Updater(){
			if (MyRenderer.material.color.a = 0) {
				MyRenderer.material.colora += FadeTime * Time.deltaTime;
			}

		}

	}

you initialize the variable in Start and using it in update, but the variable “MyRenderer” doesn’t exist nor is defined in a shared scope. add the private variable as a class variable before the start.

         public float FadeTime = 13f;
         private Renderer MyRenderer;

         void Start(){
                 MyRenderer = GetComponent<Renderer>();
         }

Variable Scope

You must declare the variable MyRenderer outside of your methods. This will fix your error about MyRenderer not being declared. Declare it like this: private Renderer MyRenderer;

Condition Checking

error CS0029: Cannot implicitly convert type float' to bool'

This error comes from this line of code: if (MyRenderer.material.color.a = 0)

Your operation in if is using an assigner, =, not what you would use to check, ==. I will recommend though, from what it appears you are trying to achieve, you should use variable < 1 so that it will continue to fade in until the color is completely changed.

Changing the Alpha Value

error CS1612: Cannot modify a value type return value of UnityEngine.Material.color'. Consider storing the value in a temporary variable error CS1612: Cannot modify a value type return value of UnityEngine.Material.color'. Consider storing the value in a temporary variable

This comes from the code MyRenderer.material.color.a += FadeTime * Time.deltaTime;.

You can not change individual values of the 1 individually (the alpha value). Change the value by declaring a new Color and changing its alpha channel, like so:

Color _tempColor = MyRenderer.material.GetColor("_Color");
        
if (_tempColor.a < 1)
{
       MyRenderer.material.SetColor("_Color", new Color(_tempColor.r, _tempColor.g, _tempColor.b, FadeTime * Time.deltaTime));
}

Final

Now you should have a functioning script. In case you still don’t, this is the final script that I came up with after modifying your code.

using UnityEngine;
using System.Collections;

public class Fadestars : MonoBehaviour
{

    public float FadeTime = 13f;
    private Renderer MyRenderer;

    void Start()
    {
        MyRenderer = GetComponent<Renderer>();
    }


    void Update()
    {
        Color _tempColor = MyRenderer.material.GetColor("_Color");
        
        if (_tempColor.a < 1)
        {
            MyRenderer.material.SetColor("_Color", new Color(_tempColor.r, _tempColor.g, _tempColor.b, FadeTime * Time.deltaTime));
        }

    }

}