Constant value `false' cannot be converted to a `float' Just need a check

Hi guys, iv been looking at this for a while but I cant seem to see it

Im getting an error for line 32, 34, 39 and 41 for “false”
this was a JS scripted but I tried to convert it to C# my self, could that be an issue?
Anyways please have a look if you have time and see if you can help me

Thanks

    using UnityEngine;
    using System.Collections;
 
    public class Lean : MonoBehaviour {
 
        public float leanLeft;
        public float leanRight;
 
        // Use this for initialization
        void Start () {
     
        }
     
        // Update is called once per frame
        void Update () {
                    if (Input.GetButtonDown ("Lean Left")) {
                            doLeanLeft ();
                    }
                    if (Input.GetButtonDown ("Lean Right")) {
                            doLeanRight ();
                    }
                    if (Input.GetButtonUp ("Lean Left")) {
                            doLeanBack ();
                    }
                    if (Input.GetButtonUp ("Lean Right")) {
                            doLeanBack ();
                    }
            }
 
        void doLeanLeft()
        {
            if (leanLeft = false) {
                transform.rotation = Quaternion.Euler(0,0,30);
                leanLeft = false;
            }
        }
        void doLeanRight ()
        {
            if (leanRight = false) {
                transform.rotation = Quaternion.Euler(0,0,-30);
                leanRight = false;
            }
        }
        void doLeanBack()
        {
            transform.rotation = Quaternion.Euler(0,0,0);
        }
    }

The first issue is you have = instead of == in the if statements. C# uses == for comparison. Second, if you’re using true and false you want to use bool instead of float. Javascript is quite different from C# in how variables work so yes part of the problem is just converting it directly from JS to C#.

It’s bacause you must use the comparative:

if (leanRight == false){
   //DO THINGS
}

thank you so much, yeah i had == in there but took it out to try and work on it, forgot to put it back in.

But again thanks again, still trying to read JS as most tuts are in JS and im learning C#