error cs0131 - The left-hand side of an assignment must be a variable, a property or an indexerplease. help!

please understand that I’m very new to coding and unity but I’m making a endless runner 2d game for ios.
i’ve got a background scroll which won’t stop scrolling once the player has died.

so I tried solving that problem with an extra bit of code on the scrolling background script -

public float speed = 0.5f;
public GameObject player;

// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {
	if (player.SetActive = false) {
		speed = 0.0f;
	}					

	Vector2 offest = new Vector2 (Time.time * speed, 0);

	GetComponent<Renderer>().material.mainTextureOffset = offest;

}		

}

the error pops up on these lines -

	if (player.SetActive = false) {
		speed = 0.0f;
	}	

Can anyone tell me where I went wrong or how to fix it?
Or maybe suggest a different way of stopping the background scroll.

I’ve searched around the internet so far found nothing of help,
other answers only led to me having this specific error.

All I want is for the background to stop scrolling once the player has died :frowning:

any help is much appreciated.

You could try this out, make a bool which, dictates if the player is dead or alive.

public bool dead;


void Start(){
     dead = false;
}

Then when the player dies, assign the bool to true.

dead = true;

In your update you make a check to see if dead is true.

void Update () {
     if (dead == true) {
         speed = 0.0f;
     }                    

I feel if you are new to this you should probably use bools, it will help you understand how conditional statements work better and makes it easier to step through your code when you debug, and yes as mentioned you should use == if you want to check a condition if something equals a condition. If you are setting your gameobjects as inactive when you are new to this, you might create more problems for yourself.