Problem with Instantiate

I’m having a problem, I want to know if it’s possible to call an Instantiate within a function to call other functions, if so how? . Example:

    public GameObject prefab;
    public void criarPlayer() {

        Instantiate(prefab, new Vector3(10, 0, 0), Quaternion.identity);

    }

Thanks

It’s a static method, so it can be called anywhere, but classes that aren’t derived from UnityEngine.Object need to access it by prefixing it with the class name:

GameObject.Instantiate(prefab, new Vector3(10, 0, 0), Quaternion.identity);

Still not working :S

I already solved the problem, thanks.