Is this a bug, should i report it, or should i just update my unity verson to the latest?

I have been trying to solve quite a few issues which “don’t exist” i have been online and cross checked the forums but its all about this script here, I’m using unity 2022.3.20f1

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

public class AttackingArea : MonoBehaviour
    [SerializeField] private static int damage = 1;

    private void OnTriggerEnter2D(Collider2D collider)
        if (collider.GetComponent<Health>() != null)
            Health health = collider.GetComponent<Health>();

    // Method declaration was incorrect, added braces for method body
    public void BuyDamageButton()
        damage++; // Corrected syntax
        Debug.Log("1 more Damage");


I have been getting

error (20,9): error CS0149: Method name expected

And CS0101 complaining about there being 2 difrent types of BuyDamageButton() and OnTriggerEnter2D and even for MonoBehavior I know this can’t be solved but i just want to know if its the unity version and what i should do

To solve this error in the future for other people the script didn’t save properly so Unity in other words save the script twice to solve this you need to close unity completely even the hub, then reopen and then fix the script- and find a duplicate in files and delete it that should solve the issue. :wink: :grinning: