Instantiating an object at mouse position

I have created a GUI button (well, texture that will act like a button) that I want to behave as follows:

  1. Click the button and the mouse cursor changes to a specific texture.
  2. When I click anywhere in the world I want to instantiate a game object that that location.
  3. Mouse cursor returns to normal.

About spawning in the world: the game is a 2d game viewed from the side, though the camera is set to perspective to get depth. The items spawned will always be spawned at the same depth though, so in theory I only need to know the position of the mouse horizontally/vertically within the gameworld.

Any help or nudge in the right direction is greatly appreciated!

Sounds like you need ScreenToWorldPoint.
Input.mousePosition will probably be of use as well.