Bool to enable/disable doublejump

Hey fellas,

My doublejump works fine but I want the player to start without the doublejump and once an object is picked up to enable it.

So far, I have this in my controller code:

[SerializeField] bool doubleJumpEnabler = false;
...
...
...
if (doubleJumpEnabler = true) {
	if(!grounded && !doubleJump && jump ){
		anim.SetBool("Ground", false);
		rigidbody2D.AddForce(new Vector2(0f, doublejumpForce));
		doubleJump = true;
	}
}

Even though I state that doubleJumpEnabler is false, I can double jump as the tickbox for the enabler is ticked. Why is it ticked when I state it is false?

You need to change

(doubleJumpEnabler = true)

to

(doubleJumpEnabler == true)

or even better

(doubleJumpEnabler)