Click and place / drag and drop

I have made a simple scene with a block in the middle and some enemys going for the block. Im trying to make a tower defence style game. I have a UI element with the gun types I have created. I want to be able to click on the guns and be able to place them or just drag and drop them. I would really like some help :smiley:

you are talking about a lot of work, but usually, from what I know, you cannot “really” drag and drop stuff in tower defense and here is how it works ( as I know ):


  1. When you click on the tower UI you want to build, you get the tower type ID and an image of the tower of will be instantiated right on your cursor as long as you keep your mouse button down ( so-called dragging)
  2. The tricky part is, in each place where players build their tower, all the towers are already there but there are just being disabled so that’s why you are seeing an empty place.
  3. So, when you drag your tower onto the place and release it, the place will enable the tower you are trying to build and disable the tower image on your cursor (dropping effect)
  4. At least that’s how I did my Plant vs Zombie demo
  5. good luck!

Regards,
Bale