Alright, this question has been bugging me for a while. It is really specific to my code so search as I have, I couldn’t find anything helpful save a few articles about clicking on GUI elements.
So here is what’s happening: I choose place a tower on the grid (tower selection is on a drop-down GUI at the top of the screen), then I choose the green-line “selector.” I select the tower I just placed putting an orange arrow and a white radius circle around the tower. When I click on any of the GUI (even a box), the tower deselects. But when I debug, all the variables are as they should be. I have even commented out large blocks of code to find the troubled area to no avail.
I have posted the current build of the game here.
The code in question is attached to my main camera, and is located here. I am really bad at commenting code when I am the only one that will see it, so I will start commenting it right away and upload that version asap.
With those resources I ask my question: Why does the tower deselect? What am I doing wrong? Is it a glitch with Unity’s code conversion? How can I get the effect I want?
In the mean-time, I will comment my code and continue reading other articles in the off chance that someone else has encountered this problem. Also, if you need more info, I am happy to offer anything that will help solve this problem.