Why is there an error here when I try to instantiate an object at the spawner's location?

I’m trying to instantiate a line into my game at the position of the spawner but when I put the coords into the code I get an error in the vector3 part of the code. I’m making a 2d game.

    public void spawnLine()
    {
        Instantiate(line, new Vector3(transform.position.x, transform.position.y, 0));
    }

The error I get is "CS1503. Argument 2: cannot convert from ‘UnityEngine.vector3’ to ‘UnityEngine.Transform’ "

You’re calling the wrong overload of Instantiate with just two arguments. See here for all the method signatures.

You need to supply a rotation for the third parameter: