Search Unity

Mouse position webGL

Discussion in 'Input System' started by douglassophies, Jan 14, 2019.

  1. douglassophies

    douglassophies

    Joined:
    Jun 17, 2012
    Posts:
    141
    My mouse was visible and moving in webGL builds but nothing was responding to it.
    I can reproduce this in the editor by switching to new input system only instead of 'both'. From debugging, it looks like doing this makes the mouse ray cast keep hitting from whatever point it started the game at with no position update.
    So two questions:
    1. Can webGL not support 'both' options?
    2. How to make the mouse update its position when using the new input system only?
     
  2. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    Do you mean UI? We do have support for UI (still WIP, though) but it does require switching out the "Standalone Input Module" on the EventSystem for the UIActionInputModule.

    Correct. Reminds me that at the very least, this should be clearly document. And better yet, display a warning/error.
     
  3. douglassophies

    douglassophies

    Joined:
    Jun 17, 2012
    Posts:
    141
    I have some code that does a raycast and tells me whats below the mouse in the world space for my RTS game. It tells me correctly what is below it on the first frame of the game starting but never updates again.
    Thanks for the info on WebGL
     
  4. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    Ah I see. Filed a ticket here and pinged our WebGL dev.
     
  5. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,338
    This should really be much more visible in the docs - either in "how do I" or at least in the migration part.

    I know the docs are WIP, but having this more visible would've made migration work a lot smoother.
     
    NeatWolf likes this.
  6. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    Heh agreed. I'll try make sure the section in the quick start gets added for the next package release.

    There's also some stuff in the works to automate the setup from the UI and automatically guide the user so that reading docs on how to get this wired up won't be necessary.
     
  7. douglassophies

    douglassophies

    Joined:
    Jun 17, 2012
    Posts:
    141
    How long is turn around on these issues? I realise i got carried away on the branch that i played with the new input system on and i don't want to abandon it becasue of other changes but if the new input system is low priority i guess it will be awhile before its fixed for web builds and i should bite the bullet.
     
  8. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    Plan is to have a stable, fully functional 1.0-preview package for 2019.1 which is targeted for March/April.

    Turn around time for fixes that require native changes (like this one probably does) isn't so great unfortunately. Takes a while for the backports to crawl their way through the release chain.
     
  9. douglassophies

    douglassophies

    Joined:
    Jun 17, 2012
    Posts:
    141
    OK thanks for the information!
     
  10. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,338
    Do you have any input on how to make the menu move commands work? IE. exactly what to do? After struggling a bunch (and realizing that it was mostly some other UI covering my buttons that were messing with me), I got mouse input to work with the module, but I can't move around with either WASD or a joystick bound to menu move.
     
  11. Juixa

    Juixa

    Unity Technologies

    Joined:
    Sep 6, 2017
    Posts:
    7
    Is this still an issue for 0.2.6-preview?