Neither of your if and else if statements on line 34 and 39 are formatted correctly. Look at how your if statement on line 25 is formatted and see where the other two go wrong.
I’m sorry for not putting it in code tags because I didn’t know how to do so since I am a complete beginner and could you explain to me what you said in easier terms? (sorry if I have bad English)
I don’t understand what you meant there at the end. I don’t have a bool that signifies if my character is not jumping only that it is jumping so even If I were to bool the isJumping how would I use it so that the missing } will go away and how will I use it in the code and I don’t know how the
if (jumpPressed && notJumping)
{
}
works
and sorry if I am bothering you, I will go to sleep I will check my replies tomorrow so sorry if I have late replies
The first part of my post is separate to the last part.
I showed you how to correct your formatting error. If that’s all you care about just do that and move on.
The last part was just showing how to make your code more readable. I know you don’t have those booleans, it’s just an example.
All if-statements are doing is checking a boolean value, ergo, whether something true or false.
For example:
int someInt = 10;
int anotherInt = 9;
if (someInt > anotherInt)
//the above gets reduced down to:
if (true)
And you can use boolen expressions to assign a boolean value:
int someInt = 10;
int anotherInt = 9;
bool someIntGreater = someInt > anotherInt; //expression equals true
if (someIntGreater) //boolean value is true so code will execute
Can’t really break it down any more than that. If this is confusing then more C# tutorials are in order for you.