How to use boolean !?!

	private static bool clicked = false;
	
	void Start () {
		clicked = false;
	}

    void FixedUpdate() {
        if (Input.GetButtonDown("Jump"))
		{
			clicked = true;
            rigidbody.velocity = new Vector3(0, 10, 0);
		}
    }
	void Update () {
		if (clicked = true)
		{
			rigidbody.velocity = new Vector3(0, -10, 0);
		}
	}
}

I can’t seem to make my character go down AFTER the first time I “click”. For some reason clicked = true. I’ve searched a lot and surprisingly I couldn’t find an answer.

PS I have used bools before. I know I’m doing something wrong but I just don’t know what.

More specifically what I’m trying to do is enable gravity after the first click.

first, clicked does not need to be static unless you have good reason.

Also, you need to proper operators. = is an assignment operator. You would need relational operator
http://msdn.microsoft.com/en-us/library/6a71f45d(v=vs.71).aspx

So
if (clicked == true) but you could just do if (clicked) but you will also need to reset the bool if you don’t intend for it to be true all the time after the first click. Where you set it to false is your choice.

Also no need to set it false in Start as it is already false in the decleration.

Try this video too. It helped me when I was starting out.

Thanks. I set it to false at the start because I thought for some reason it was being set to true. I always forget to put “==” instead of “=” maybe 'cause I don’t fully understand it…

Well, basically you need to forget what your math classes in school taught you about the “=” operator. It looks like the thing you used in school, but it is not the same thing.

“=” to a computer does not mean “equals”, it means “assign”. So when you say “x = 5;” in programming you’re not saying “x equals five”, you’re saying “x is assigned the value of 5”. Inside the computer, this means that the value “5” is copied into the piece of memory represented by the identifier “x”.

Similarly, “==” does not mean “equals”, it means “check equality”. So when you say “x == 5” you’re saying “check if the value assigned to x is equal to 5”, and the computer will return ‘true’ if it is and ‘false’ if it is not.

Hope that helps!

Thanks helped a lot!