GUI Creates a prefab?

How would i go about making a GUI button that then creates a prefab at the point where the player has clicked, but then lock it to a certain axis? kinda like a tower defense game. you select your tower and while you still have it selected you place it a long a certain axis to put it on the plain?

Check out this video and this video! Hope this helps!

(Make sure to click the check mark by my answer if this answers your question!)