(Noob question) Error CS1003: Syntax error ',' expected

Hi, Im totally new at coding (been doing it just for a few days), so sorry if this is a easy fix and I just missed something. Im following a tutorial on youtube and using Visual Studio, so you know.
I got an error message (5,48); error CS1003:Syntax error, ‘,’ expected
How can I fix it?
Thank you

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

public class NewBehaviourScript : MonoBehaviour;
{
    public static DialogueSystem instance;

    public ELEMENTS elements;

    void Awake()
    {
        instance = this;
    }

    // Use this for initialization
    void Start()
    {

    }

    /// <summary>
    /// Say something and show it on the speech box.
    /// </summary>
    public void Say(string speech, string speaker = "")
    {
        StopSpeaking();

        speaking = StartCoroutine(Speaking(speech, false, speaker));
    }

    /// <summary>
    /// Say something to be added to what is already on the speech box.
    /// </summary>
    public void SayAdd(string speech, string speaker = "")
    {
        StopSpeaking();

        speechText.text = targetSpeech;

        speaking = StartCoroutine(Speaking(speech, true, speaker));
    }

    public void StopSpeaking()
    {
        if (isSpeaking)
        {
            StopCoroutine(speaking);
        }
        speaking = null;
    }

 
}

You don’t need the ‘;’ at the end of line 6 for one thing.

When i delet the “;” on line 6, I get 3 new error message
(6,14)error CS0101: The namespace already contains a definition for ‘NewBehaviourScript’
(18,7) error CS0111: Type ‘NewBehaviourScript’ already defines a memeber called ‘Start’ with the same parameter types
(8,16) error CS0246: The type or namespace name ‘DialogueSystem’ could not be found
What should I do? Im just confused rn.

1 Like

That means you have two scripts in your project both with classes named NewBehaviourScript, you need to change that to whatever you want the class to be called and the filename of the script should be the same.

1 Like

Thank you so much! Theres just so much text, and my head didnt connect that, thank you again!

This may be useful to you:

How to understand compiler and other errors and even fix them yourself:

1 Like