I have a game that uses the Starter Assets First Person Controller. It works just fine and it shows the cursor on the screen. When I press the left mouse button, the cursor goes away. When the player walks around, I have a UI panel that pops up when the player meets a character. The UI shows the character’s dialog in text as he speaks. At the end of the speech, the character asks a question of the player, presenting up to 5 buttons for answers. Using the FPC, it does not recognize when I press a button on the UI. What can I do to make the buttons responsive by clicking it with the left mouse button and why does the cursor go away when i press the left mouse button, whether I’m selecting a UI button or not?
I found the problem. First of all, I deleted Unity’s Starter Assets that took up a huge amount of space that was totally unnecessary. Then I followed the instructions of Acacia Developer on Youtube ([Unity] First Person Controller [E01: Basic Controller] - YouTube) to develop a simple first person controller with very few lines of code I very much appreciated the thorough explanation he gave of how everything works. The only difference in the code that I wrote is that I do not remove the cursor. I attached that C# script component to the Player. I also attached the Unity Character Controller component. I established a UI Event Handler as a separate Game Object. On each of the buttons, I have an OnClicked subroutine in my UI handler script. A very important thing on the buttons in the inspector is to specify that it works in both Editor and on Play. Everything works now. The only other thing I did was whenever the Player meets a character, I freeze the movement and have the Player look directly at the character to see him speaking (I use SALSA to see the mouth moving and use iClone characters imported into Unity to make sure the mouth can move.). By freezing the Player from moving, the cursor can be easily placed on the different buttons. Now, I need to develop some useful dialog and questions for both the Player and the characters as I continue to develop a game that hopefully will be very interesting to play.