What's wrong with this code? I'm using invoke to call a function.

Invoke isn’t working and it’s bringing up the following 2 errors:

Assets/WelcomeMessage.cs(17,10): error CS1525: Unexpected symbol `disableCanvas’

and

Assets/WelcomeMessage.cs(17,2): error CS1520: Class, struct, or interface method must have a return type

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

public class WelcomeMessage : MonoBehaviour {

    public string myMessage = "Welcome!";
    public Text welcomeText;
    public GameObject canvasWelcome;

    // Use this for initialization
    void Start () {
        MyWelcomeMessage();
    }

    Invoke("disableCanvas", 3);

    void MyWelcomeMessage()
    {

        if (welcomeText != null) {
            welcomeText.text = myMessage;
        } else {
            Debug.LogWarning ("welcomeText is not assigned!");
        }
           
    }



    void disableCanvas()
    {
        canvasWelcome.SetActive (false);

    }

}

Any help would be greatly appreciated. Thanks!

Your Invoke needs to be in a method.
For instance in Start.
Don’t see anything else wrong…

That actually solved it! thank you so much, rookie mistake on my part haha