- Home /
left click does not work,Left Mouse Button Does Not Work
left click does not work, right click does, but not left. i have a UI button in my game that has to be left clicked, so you see how thats a problem
Please Help, me and my freind have been working on this game awhile now, dont want it to go to waste
using System.Collections; using System.Collections.Generic; using UnityEngine;
public class Exit : MonoBehaviour { // Start is called before the first frame update void Start() {
}
// Update is called once per frame
void Update()
{
}
public void doExitGame()
{
Application.Quit();
}
},Left Click does not work, right click does, but not left. I have a button in my game, it needs to be left clicked to work, so you see how that is a problem
Answer by Chimz · Sep 25, 2021 at 07:42 PM
Are you using UnityEngine.UI? I'm not seeing it in your code so I assume not.
Add this to the using section:
using UnityEngine.UI;
Your answer
![](https://koobas.hobune.stream/wayback/20220613043450im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Camera scripting references 0 Answers
Unity not recognising space bar and left click 5 Answers
Issues w/ mouse cursor position using First Person Controller 0 Answers
Left mouse button not working 1 Answer