Place a prefab in game on button click

Hey guys, I am new to unity and I am trying to create a game where the player can spawn in minions from some in-game buttons by clicking them and dragging the minion and placing them into the game world. Kind of like an RTS building placement system.

I followed a tutorial which gave me the desired effect:(Unity Tutorial: Building Placement - YouTube)

But I found out after completing the tutorial that Unity added an easier way to create buttons on a canvas rather than hard code them like in the tutorial and i would like to migrate the placement system to the new Unity 5 buttons for ease of use, but for the life of me I cant figure it out or find any help online.

Any point in the right direction or explanation would be greatly appreciated!

Sorry if my post is confusing in any way, yours sincerely a very confused individual.

Whatever happens when you click the button, create a new public function/void and add the code that you used on your old buttons and when you add your new buttons to the canvas in the inspector scroll down the to onClick function and locate the public function/void you created.

**Hope this is easy to read and understand and the fix should be along those lines^.

Go into the buttons and add a System Event Type Component, then select OnPointerClick and have it execute the function from your script by dragging in the parameters, this is probably the simplest way to do this.

@Bebop980