Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

XBox Point and Click

Discussion in 'Windows' started by AiRobotMedia, Dec 26, 2018.

  1. AiRobotMedia

    AiRobotMedia

    Joined:
    Jun 13, 2018
    Posts:
    61
    Hi all

    I have a point and click app which is on Windows (UWP) and android. I noticed most of the downloads are using Xbox. I have not added anything special to support Xbox. I have support for keyboard, mouse and touch.

    The question is does Xbox One have a cursor?

    What do you need for a point and click interface on Xbox One?

    I have an Xbox controller for testing controller support on a PC. I don't have an Xbox (or TV to hook it up to).
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,646
    If you're using the XAML build type, it will emulate the mouse using a fake cursor that gets moved using the analog sticks. If you're using D3D build type, the cursor will not be available.
     
  3. AiRobotMedia

    AiRobotMedia

    Joined:
    Jun 13, 2018
    Posts:
    61
    I am using XAML build type, so I guess I have a cursor on Xbox one.

    Looked for an XBox emulator and found non exist so I have no way to test.

    I am using Input.GetMouseButtonDown(0)) to detect clicks on the screen. In the docs there is no mention of anything else but mouse support.

    https://docs.unity3d.com/ScriptReference/Input.GetMouseButtonDown.html

    So I guess I should change that to Input.GetButton("Fire1") which will support mouse and controller.

    https://docs.unity3d.com/ScriptReference/Input.GetButton.html

    Thanks for the help.
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,646
    Input.GetMouseButtonDown(0) will probably work on XAML build type. I can test next week as I don't have access to an xbox right now.