In Unity I have a simple world space canvas with a single button set up. If you click the button with the mouse it works. If you use another method (Like 'joystick button 0') it will not activate the button. Once 'mouse button 0' has been clicked once subsequent button clicks using the 'joystick button 0' register.
Additional info; If you set the project to VR or move cursor away from the button 'joystick button 0' will continue to activate the button even if the cursor isn't over the button. It will stop once 'mouse button 0' is pressed to deselect the button.
The goal is to use 'joystick button 0' / 'joystick button 1' as the only inputs to the canvas and ultimately have a mouse look feature using a joypad. Any Idea what is going on / how to get this working?
Input is the default unity setup. ('mouse 0' only mapped to 'Fire1' / not mapped to 'Submit') (EventSystem's "Submit Button" is mapped to 'Submit')
See Script:
using UnityEngine;
using System.Collections;
public class ButtonTestScript : MonoBehaviour {
// Update is called once per frame
void Update () {
if (Input.GetButtonDown("Submit"))
Debug.Log("Submit");
else if(Input.GetButtonDown("Cancel"))
Debug.Log("Cancel");
//Lock The Cusor
Cursor.lockState = CursorLockMode.Locked;
Cursor.visible = true;
}
public void ButtonClick()
{
Debug.Log("Button Clicked = " + gameObject.name);
}
}