can someone tell me what im doing wrong?

unity is expecting a } but if I do that that one } will be too much and it won’t work at all

using UnityEngine;

public class Character2DController : MonoBehaviour
{
    // Start is called before the first frame update
    public float MovementSpeed = 1;
    public float JumpForce = 1;

    private Rigidbody2D _rigidbody;

    private Animator anim;

    private void Start()
    {
        anim = GetComponent<Animator>();
        _rigidbody = GetComponent<Rigidbody2D>();
    }

    // Update is called once per frame
    private void Update()
    {
        var PlayerMovement = Input.GetAxis("Horizontal");
        transform.position += new Vector3(PlayerMovement, 0, 0) * Time.deltaTime * MovementSpeed;

    if(PlayerMovement == 0)
    {
        anim.SetBool("isRunning", false);
    }
    else
    {
        anim.SetBool("isRunning", true);
    }

    if(Input.GetButtonDown("Jump") && Mathf.Abs(_rigidbody.velocity.y) < 0.001f) true;
    {
        _rigidbody.AddForce(new Vector2(0, JumpForce), ForceMode2D.Impulse);
         anim.SetBool("isJumping", true);
    }

         else if (Input.GetButtonDown("Jump") && Mathf.Abs(_rigidbody.velocity.y) > 0.001f) false;
         {
            anim.SetBool("isJumping", false);
         }
       
        }
    }

Please post code in code tags, not screenshots.

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)

Look at your first if-else statement:

    if (PlayerMovement == 0)
    {
        anim.SetBool("isRunning", false);
    }
    else
    {
        anim.SetBool("isRunning", true);
    }

Notice how PlayerMovement == 0 is between two brackets?

Now look at the next one:

if(Input.GetButtonDown("Jump") && Mathf.Abs(_rigidbody.velocity.y) < 0.001f) true;

Why is there a true just hanging off the end?

It should be:

if (Input.GetButtonDown("Jump") && Mathf.Abs(_rigidbody.velocity.y) < 0.001f);

It can also be easier to break these down into boolean values:

bool jumpPressed = Input.GetButtonDown("Jump");
bool notJumping = Mathf.Abs(_rigidbody.velocity.y) < 0.001f;

if (jumpPressed && notJumping)
{

}

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.