Search Unity

Resolved Unity MARS inputs (mouse, keys) not working on device view?

Discussion in 'Unity MARS' started by JCWinter, May 13, 2021.

  1. JCWinter

    JCWinter

    Joined:
    Sep 28, 2018
    Posts:
    3
    Hi there,

    I am trying to simulate touch press by using Input.GetMouseButtonDown(0) or Input.GetKeyDown to no avail. When I build it works, but nothing happens when I play in the Device/Simulation view. Is there an additional step I'm not aware of?
     
  2. mtschoen

    mtschoen

    Unity Technologies

    Joined:
    Aug 16, 2016
    Posts:
    194
    Hi there! Because Device view still operates in Edit mode, input works a little differently. Currently, we do not support mouse input in the Device View, but you should be able to test and run your app in Game View in Play Mode. By default, MARS will load a simulation environment and let you drive the camera around just like you can in Device View when you test your app in Play Mode. In this context, your input interactions should work.

    If you aren't seeing an environment get loaded in Play Mode, you should check the MARS simulation settings. You should have "Simulate In Play Mode" enabled under `Project Settings > MARS > Simulation > Scene Module`.

    Hope this helps!
     
  3. JCWinter

    JCWinter

    Joined:
    Sep 28, 2018
    Posts:
    3
    Thank you so much for your quick response. I gave that a shot, but my Game View is super pixelated and unfortunately not receptive to inputs either (it doesn't look to be running my script at all, just displaying all original objects in the scene). Any other suggestions I could try?
     
  4. mtschoen

    mtschoen

    Unity Technologies

    Joined:
    Aug 16, 2016
    Posts:
    194
    Game view being pixelated sounds odd. Do you have the view scaled, maybe? There's a slider in the top bar of game view which scales it, and scroll wheel with the mouse over the game view will also scale it up. Also, just to make sure this is clear, the "Play" button in the device view is not the same as Play Mode. You should be using the main Play button a the top of the editor window to test your full app flow in the Editor, not the device view.

    Could you provide a screen capture or a series of screenshots so we can see what you're seeing?
     
  5. JCWinter

    JCWinter

    Joined:
    Sep 28, 2018
    Posts:
    3
    I'm so sorry, it absolutely was the scale and I should have realized! It's working beautifully now.
     
  6. mtschoen

    mtschoen

    Unity Technologies

    Joined:
    Aug 16, 2016
    Posts:
    194
    It's all good! That feature can sure be confusing! Happy to help :)