Create objects on a mouse click in 2D

Ive looked up many ways to try this but it never works. Im trying to make a platform prefab spawn at the mouse when its clicked. Again though, this is in 2D! If you know how to, please tell me but nothing will work for me. Heres my code:

using UnityEngine;

public class ObjectCreation : MonoBehaviour {

    public Transform Prefab;

    void Start()
    {
     }
	
	void Update () {
		
        if(Input.GetMouseButton(0))
        {
            Instantiate(Prefab, new Vector3(Input.mousePosition.x, Input,mousePosition.y, 0), Quaternion.identity);
        }

	}
}

EDIT:

Thanks a lot @Luo_Yang for the help. I had a different result but this question is now answered.

  1. You need to pass in 0 or 1 into getMouseDown for either the left or right buttons.
  2. You have calculated the mouse position but never use it. Instead of using Plat use mousePosition.