Multiple errors that I don't know how to fix

I am trying to make 2d combat in my game by following this

Brackeys tutorial. I have gotten a couple errors that I cant find a solution to.

I have this in 5 different places: error CS1022: Type or namespace definition, or end-of-file expected

I have this in one place: error CS8124: Tuple must contain at least two elements.

I have this in 2 different places: error CS0116: A namespace cannot directly contain members such as fields or method

I also have an expected β€œ)” even though I have close brackets everywhere

Heres my code:

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

public class PlayerAttack : MonoBehaviour
{

    public Transform attackPoint;
    public float attackRange = 0.5f;
    public LayerMask EnemyLayers;

    Animator anim1;
    // Start is called before the first frame update
    void Start()
    {
        anim1 = GetComponent<Animator>();
    }

    // Update is called once per frame
    void Update()
    {
        //Play an attack animation
        if (Input.GetMouseButtonDown(0))
        {
            anim1.SetTrigger("Attack");
        }
       
        //Detect enemies in range of attack
        Collider2D[] hitEnemies = Physics2D.OverlapCircleAll(attackPoint.position, attackRange, enemyLayers);

        //Damage them
        foreach (Collider2D enemy in hitEnemies)
        {
            Debug.Log("we hit" + enemy.name);
        }
    }
}

void OnDrawGizmosSelected();
}
    if (attackPoint == null)
        return;

    Gizmos.DrawWireSphere(attackPoint.position, attackRange);
}

Thank you for any help!

Forgot to mention what line they’re on:
error CS1022 on line 40, 41, 41 (again), 44, 45.
error CS8124 on line 41
error CS0116 on line 44, 44 (again)
And the expected β€œ)” is on 41

void OnDrawGizmosSelected();

You have a ; at the end of the line. Remove it.
And on the very next line it should by

{

but you have

}

You also need to move the } from line 37 to the very end of the script. At the moment your OnDrawGizmosSelected method is outside of your class.

1 Like