Getting errors but not sure what the problem is

My code is ahead:

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;


public class Control : MonoBehaviour
{
    public GameObject player;
    public Rigidbody2D rb2d;
    public float runSpeed = 10f;
    float horizontalMove = 0f;
    private void FunctionForJump()
    {

        rb2d.AddForce(new Vector2(100f, 0f));
 
     }

    void Update()   {

        horizontalMove = Input.GetAxisRaw("Horizontal") * runSpeed;
    }


    void FixedUpdate()
    {
        if (Input.GetKeyDown((KeyCode)32))
        {
            FunctionForJump();
        }

5537617--569431--upload_2020-3-1_17-34-51.png

I keep getting these error messages:

and when I press space nothing happens.

I am very confused at what is wrong could anyone help?

edi: I fixed it

@ohammond111

Hi - just check your “{ }” blocks - these characters are used in pairs.

If you are missing the other “end” of a block (or more than one similar cases), the class won’t compile and you get errors.

BTW - begging help and using it as your topic is not helpful, quite the inverse usually, the thread name doesn’t even tell what you have problem with…

thanks, just relised I have 2 less }s than {s.

Sorry about the topic.

“Sorry about the topic.”

  • You can always change that I think. There should be a button to edit topic too, if I remember correctly.