unity3d instantiate and drag object with mouse

Could you help me on a topic.

When clicked with a mouse, an object must be created and moved to the position of the mouse in its position.

Age of empires, as in the form of build logic.

My english is not very good, sorry.

Thank you very much for your help.

From Unity - Scripting API: Input.mousePosition

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour
    public GameObject particle;
    void Update()
        if (Input.GetButtonDown("Fire1"))
            RaycastHit hitInfo;
            Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
            if (Physics.Raycast(ray, out hitInfo))
                Instantiate(particle, hitInfo.point, transform.rotation);

This instantiates an object at the position of the mouse, when “Fire1” is clicked, which is left click on a mouse usually for example.