- Home /
Right Click Detection works in Editor, not on Web Player (context menu is off). What's going on here?
Hello! I'm in the throws of making a top down RPG with a Click-To-Interact system. This system hinges on Raycasting to different points based on if the Right Click button is down. This is also the way I bring up the Interaction menu on any Item or Skill (IE, this right click is mandatory atm for the game style). My problem is that it works absolutely fine in the editor, but when I export the Web Player, right click doesn't work at all! As in, no input, no response.
I made sure to turn off the Context Boxes on the web build, as that was an issue at first, but that's all I've done in that regard. It's a tough problem to troubleshoot since it's not a problem normally in the editor! Here is an example of exactly what I'm doing:
(this is a snip from my Inventory section based on the HacknSlash tutorials)
if(GUI.Button(new Rect(20 + (x buttonWidth), 40 + (y buttonHeight), buttonWidth, buttonHeight),new GUIContent(Resources.Load (PC.Instance.Inventory[cnt].Icon) as Texture2D,PC.Instance.Inventory[cnt].ToolTip()), "Inventory Slot Common")) {
//Right Click Menu Check
if(Event.current.button == 1) {
Debug.Log("Right clicked on item!");
<Open window, or Skill, etc>
return;
}
Anyone know of any reason this wouldn't work? Thanks in advance.
Update: Turns out this is NOT just the web player, this is ALL compiles!
Heh, this just keeps getting worse; turns out LEFT clicking isn't even working on ANY compile when utilizing the GUI elements...