Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Mouse input offset problem in web fullscreen

Discussion in 'Editor & General Support' started by GuyTidhar, Mar 2, 2011.

  1. GuyTidhar

    GuyTidhar

    Joined:
    Jun 24, 2009
    Posts:
    320
    Hi,

    I am having an annoying case reproducing only on very certain PCs.
    The problem is, once I go to fullscreen in the webplayer, all the gui buttons have an annoying y offset of input compared to the actual drawing.
    So when I place the mouse cursor above a button, the click and hover is recognized only when the cursor points at about the middle of the button and until about half the button height below the actual button.
    It as if the input rectangle is offset by about half the height of a button's graphics.

    This happens on a PC with XP, IE6, directx 9.0c, 1024x768 LCD (a few dozens of them with same hardware).

    Since unity does input and graphics from 1 function call (e.g. "if (GUI.button(...))", and it happens on all buttons, along all scenes, using several code solutions, I am wondering if this might be a weird unity issue.

    In any case - did anybody encounter such an issue or have any solution suggestions for this?

    (please note, that although this happens on specific hardware and software, it happens on dozens of the same PCs that have the exact same software installed and we need to be able to solve this for these PCs).
     
    Last edited: Sep 26, 2011
  2. Hakimo

    Hakimo

    Joined:
    Apr 29, 2010
    Posts:
    316
    Lol, I actually have the same problem. Appearance wise, the image for the button is there but it's collision area/hitbox seems to be the problem. In my case, my game is made for a 4:3 resolution. I'm also using a script to maintain aspect ratio. Whenever I change the resolution to 16:9, the hitbox is offset. Bugs the hell out of me and I don't know how to fix it :(
     
  3. nawash

    nawash

    Joined:
    Jan 29, 2010
    Posts:
    166
    Same problem here....
    The offset is clearly vertical and not horizontal....
    My customer is asking me to fix it.. but I can not...
    Any word from Unity team ?
     
    Last edited: May 10, 2011
  4. Quietus2

    Quietus2

    Joined:
    Mar 28, 2008
    Posts:
    2,058
    That word would not come here, but from correspondence through the bug report that you filed.
     
  5. nawash

    nawash

    Joined:
    Jan 29, 2010
    Posts:
    166
    OK, Thank you, waiting for feedback from the bug report.
     
  6. obsidian1269

    obsidian1269

    Joined:
    May 12, 2011
    Posts:
    23
  7. Edwige

    Edwige

    Joined:
    Nov 25, 2010
    Posts:
    35
    Same issue. Does anyone has a trick to avoid having the problem ? (as it seems it can't be solved properly)
     
  8. obsidian1269

    obsidian1269

    Joined:
    May 12, 2011
    Posts:
    23
  9. chester8885

    chester8885

    Joined:
    Apr 20, 2011
    Posts:
    7
    I' ve got the same problem on my computer, but on the other computers at work everything is ok. Does anyone have found solution for this bug?
     
  10. agentsmith

    agentsmith

    Joined:
    May 1, 2010
    Posts:
    132
    I posted my solution to this problem in another thread...but basically when I manually set the resolution (Screen.SetResolution) it worked fine. Even if you set it at the default webplayer's fullscreen settings (600x450?).

    Did this resolve anyone else's problem?

    -Smith
     
  11. agentsmith

    agentsmith

    Joined:
    May 1, 2010
    Posts:
    132
    I sent a bug report and I need more info for the QA rep. If you'd like to post here or message me your specs (OS, CPU, GPU, etc) I can forward it the rep.

    Thanks!
     
  12. CreativeChris

    CreativeChris

    Unity Technologies

    Joined:
    Jun 7, 2010
    Posts:
    456
    Hello,

    Just a follow up, are users still experiencing this mouse offset problem with the latest 3.4 WebPlayer? @agent_smith kindly asked if anyone could reply with their machines specs, if people are happy to do this, can you please reply with the answers to these questions:

    We need machine spec info such as OS, CPU, RAM and GPU?

    Also which browser and the version?

    Which WebPlayer game does this issue reproduce with?

    Thanks,
    Chris
     
  13. nawash

    nawash

    Joined:
    Jan 29, 2010
    Posts:
    166
    Hi
    I still have the problem with the 3.4 Webplayer
    Windows 7 Professionnel 64-bit (6.1, Build 7600) (7600.win7_gdr.110408-1633)
    Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz (8 CPUs), ~2.8GHz
    Memory: 8192MB RAM
    NVIDIA GeForce GTX 460
    Internet Explorer 8.0.7600.1685

    The "game" is under NDA, I can not disclose it here.

    I hope you can help, guys :-|
     
  14. nawash

    nawash

    Joined:
    Jan 29, 2010
    Posts:
    166
    SEEMS that the Y offset matches the window's title bar height (GetWindowRect VS GetClientRect ?)
     
  15. Granulated

    Granulated

    Joined:
    Sep 3, 2011
    Posts:
    3
    is this EVER going to be fixed ? I'm not a developer, just a concerned Tiger Woods online player who is amazed the problem has gone unrectified for about 4 months now.
     
  16. Granulated

    Granulated

    Joined:
    Sep 3, 2011
    Posts:
    3
    hmmm.. i also have the gtx460
     
  17. agentsmith

    agentsmith

    Joined:
    May 1, 2010
    Posts:
    132
    Although I sent my specs to Chris in the bug submission; for everyone else here's what I got:

    Windows 7 Ultimate 64bit
    Dual Core, Dual Opteron 265
    4GBs ECC RAM
    Nvidia GeForce GTX 580
    DirectX 11

    Google Chrome v14.0.835.126
    Internet Explorer v9.0.8112.16421

    Could this be with the GTX 480/580 family?

    I agree with Granulated it's been a VERY long time (nearly a half year!) and I still can't play anything in full screen. :(
     
  18. CreativeChris

    CreativeChris

    Unity Technologies

    Joined:
    Jun 7, 2010
    Posts:
    456
    Hello,

    Thanks for providing details regarding hardware specs,

    I have tested on NVIDIA GeForce GTX 460m just now and that didn't provide a repro for me,

    One more thing that I missed is display and fullscreen resolution, if you could post a reply showing what your screen resolution is on windowed and fullscreen that may help us narrow down this issue.

    Thanks for your patience while we try to determine a repro case!
     
  19. agentsmith

    agentsmith

    Joined:
    May 1, 2010
    Posts:
    132
    Hey Chris,

    No repro.. total bummer :( As far as the window and full screen resolution it happened in all the ones I used... I can use the default settings for WebPlayer and it'll happen. It'll happen if I specify the resolutions for both window full screen to something not default as well.

    Although I must say the GTX 460m (mobile card) is entirely different from the GTX 460/580 (Desktop cards). Is it possible to try one of our video cards?

    Thanks!

    Jordan
     
  20. CreativeChris

    CreativeChris

    Unity Technologies

    Joined:
    Jun 7, 2010
    Posts:
    456
    Hello,

    Just an update regarding this,

    We have the NVIDIA GeForce GTX 460 now in our office and I have ran some tests, unfortunately I have still not found a repro case for this issue, I have ran webplayers in IE 8 9, latest FF Chrome and no luck, so I tried setting different desktop resolutions and this didn't seem to make any difference :(

    Does everyone have updated drivers to their 460 cards? I installed the drivers which came on a disk with the purchase of the GPU. Might be worth checking drivers are upto date?

    Thanks!
     
  21. agentsmith

    agentsmith

    Joined:
    May 1, 2010
    Posts:
    132
    Hey Chris,

    I just built a new computer today (completely different CPU, motherboard, ram, etc) however I kept my geforce gtx580. I just tried the webplayer and I'm still experiencing the same problem. Drivers are up to date, as of today, for both Windows 7 the video card. I recently replaced some of my GUIButtons with scripts attached to GUITextures and they have the same problem so it doesn't appear to be localized to GUIButtons.
     
  22. CreativeChris

    CreativeChris

    Unity Technologies

    Joined:
    Jun 7, 2010
    Posts:
    456
    If you're experiencing this problem with your computer, please reply with detailed information about computer specs and what mouse you are using:

    Operating System:
    Processor:
    Memory:
    DirectX version:
    GPU:
    GPU driver:
    Native screen resolution:
    Fullscreen resolution (if different):
    Browser and version:
    Mouse manufacturer and driver version:

    Thanks!
     
  23. Draco18s

    Draco18s

    Joined:
    Aug 15, 2011
    Posts:
    109
    Didn't see this thread right away, but I too am having this issue on one of my computers (the development machine specifically).
    Hardware:

    Windows Vista
    Intel i7 920 (2.67Ghz, x4 cpus)
    Oodles of RAM (12 GB)
    DX11
    ATI Radeon HD 4800 series (3571 MB, 1920x1200)

    Google Chrome and Firefox
    Latest Unity Player

    The other and very odd issue is that not only is the y offset 22 pixels downwards (so instead of 1,1 being the upper left, it's -2,-21) but that I don't get the full height. The fullscreen player isn't 768 pixels tall. It's 743 pixels tall.

    And that has it's own weirdness too: why is the fullscreen resolution 1024x768 regardless of my monitor's native resolution and regardless of the application's intended resolution?
     
  24. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Stragely enough I sometimes get this issue inside the Unity GUI, only seen it together with running apps inside the unity editor.

    Its only like 10 pixels or so, but very annoying.
     
  25. yosh

    yosh

    Joined:
    Mar 13, 2009
    Posts:
    142
    Hi, we have the same issues.
    When our content is running in window mode, all works well.
    But after switching to fullscreen mode, all buttons (EZGUI as well as Unity GUI) have an y-offset of about 20 pixels.

    Here´s one hardware system:

    Internet Explorer 6 (yeah, we need to test it there ;) )
    Windows XP SP 3
    Intel P4 3 Ghz
    2 GB Ram
    Nvidia Quadro FX 2000, 128 MB
    Forceware: 169.96
     
  26. Zergling103

    Zergling103

    Joined:
    Aug 16, 2011
    Posts:
    392
    Hey there, I'm getting these issues often, but so far only with the Editor itself. It ususally happens whenever there is a massive slowdown while running the game in the editor and it's when I try to pause or stop it that I notice it. The glitch doesn't affect any Windows GUI like the menu bar or the placement of child windows.

    I haven't receieved this problem now that I've bought a better computer as far as I can recall. The old computer was a factory-built Acer Aspire 5535 and the specs that I remember off hand are:

    2 GB Ram
    DirectX Version: Hardware 9 - Software 11
    1366 x 768
    Microsoft Wireless Mobile Mouse 4000 with the latest drivers as of today.

    The other stuff can be found with google since I didn't modify the laptop after I recieved it.
     
  27. Lancemaker_

    Lancemaker_

    Joined:
    Nov 14, 2011
    Posts:
    34
    Guys, im a complete noob scripting, but i found a solution to a problem related to this "bug". in my case i found this was not a bug, just a bad script.
    In my particular case i was scripting a crosshair, i was modifying it from a fps tutorial i got here in the page 14. In this case the "Start ()" function draw the crosshair just once, and it will not refresh it. Start function will keep the crosshair at that location even if we change the screen resolution. So i changed the start() function to function Update(). I cant tell how happy i am couse i was stuck with this problem for 3 days. I will post this at unity awnsers also, Now i will ask you if this is a good solution economicly. I dont know if its a good idea keep refreshing it if it raise the draw calls too much. mabe if we can listen to the change resolution process we can then redraw it only when needed.
     
    Last edited: Nov 14, 2011
  28. AnomalusUndrdog

    AnomalusUndrdog

    Joined:
    Jul 3, 2009
    Posts:
    1,546
    I've actually experienced something similar when I was teaching. The mouse Y was offset, but this was happening in the Unity Editor, not on a published game. It was happening even outside the game GUI, it was happening on the Unity Editor GUI. I thought it was Windows acting up but the other programs don't exhibit the same behaviour if I recall correctly.

    I'll edit this post later to add the specs of the PC where it happened.
     
  29. RasmusK

    RasmusK

    Joined:
    Jan 16, 2012
    Posts:
    3
    Happens for me occasionally inside Unity itself when Error Pause is turned on and Debug.LogError is called - have never experienced it with Error Pause off.
    The same was experienced on another computer with almost identical hardware.

    Operating System: Windows 7 64 bit
    Processor: Core i5 750
    Memory: 4 GB
    DirectX version: DirectX 11
    GPU: NVIDIA GeForce GT 220
    GPU driver: 8.17.0012.6724
    Native screen resolution: 1280 x 1024
    Fullscreen resolution (if different):
    Browser and version: N/A
    Mouse manufacturer and driver version: Logitech MX518, standard HID driver v. 6.1.7600.16385
     
  30. agentsmith

    agentsmith

    Joined:
    May 1, 2010
    Posts:
    132
    After Updating to Unity 3.5 beta; I no longer experience the Y offset issue using the webplayer in fullscreen mode.

    Using Chrome v17.0.963.46 beta-m:
    However when I right click to pull up the menu to get into fullscreen mode, I can't click any of the options (Go Fullscreen, About Unity plugin, or Setup). If I rapid fire click an option eventually it'll take but it's really hard to do and I'm not always successful at it. When I hover my mouse over the options they properly highlight (mouse cursor hover)

    Using IE v9.0.8112.16421:
    No issues with the "right click" menu; all options (Go Fullscreen, About Unity plugin, or Setup) function normally.
     
  31. nawash

    nawash

    Joined:
    Jan 29, 2010
    Posts:
    166
    This seems to be a good news... cool, if this is fixed :)
    The new issue is worrying....
    Thank you for your feedback.
     
  32. gvaughan

    gvaughan

    Joined:
    Jan 28, 2010
    Posts:
    32
    I'm also experiencing a similar issue, but with the standalone player (in this case, Windows)

    Because I need to be able to control some z-ordering, I'm not running the game(s) in full screen, but instead running the game with no chrome. I've done this through launching the process and using the window's api to remove the title bar and frame, but also with the command line option -popupwindow. Both have the same y offset problem.

    To solve this, I've forced the ratio of the window to be a bit skewed, 570 high vs the standard 600 for 800x600. While this does a decent job, it's really not the ideal solution. Interesting to note though, is that the offset if just about the height of the title bar, so maybe that is a factor. I'd be interested in hearing more about this too.
     
  33. GuyTidhar

    GuyTidhar

    Joined:
    Jun 24, 2009
    Posts:
    320
  34. Benproductions1

    Benproductions1

    Joined:
    May 11, 2011
    Posts:
    63
    I have recently experienced a new version of this bug in windows standalone with unity 3.5
    When I put the game into fullscreen mode at a low resolution, it seemed that the mouse was restricted to the top left corner of my screen at the resolution of the game non fullscreened, eventhough the game was set to fullscreen.
    I really hope this problem can be fixed soon :)

    Since it seems the graphics card and windows are the problem I will post those:
    Windows 7 32 bit
    Intel R 4 Series Express Chipset Family

    Hope this helps