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

IOS screen area problem

Discussion in 'iOS and tvOS' started by Finjitzu, Jan 19, 2014.

  1. Finjitzu

    Finjitzu

    Joined:
    Sep 8, 2011
    Posts:
    160
    So I'm testing with IOS now and ran into a weird thing. It seems like my Ipod 5th gen I can't touch any of the edges. My buddy is having the same problem with his Iphone 5.



    Anyone else run into this? Should I just re-position my gui to compensate? I've been reading some issues with 5th gen ipods/iphones how the touch screens are wonky...
     
  2. Agent_007

    Agent_007

    Joined:
    Dec 18, 2011
    Posts:
    899
    What Unity version are you using?
     
  3. amanset

    amanset

    Joined:
    Oct 19, 2013
    Posts:
    11
    Copy + pasting my reply to you on NeoGAF (so that people here can see it too):

    Yes, I went through this over the weekend as well. I have an off-screen border for on-screen things to collide with (so as to keep them on screen) and I ended up logging the tag of what GameObjects a touch hit. For some reason on just one edge, possibly to do with the hidden status bar, the game was flagging a hit with the off-screen border. The border was definitely not showing and my touches worked everywhere else. I ended up moving the collider a tiny bit away from that edge and everything works fine. OK, now objects can be a tiny, tiny bit off screen but it doesn't affect gameplay at all (things move to fast for anyone to notice).

    I had originally thought that it was due to the Notification Centre drag down, but now I have touches working fine up at the top of the screen. All very weird. Glad to hear it wasn't just me.

    For the record, I am on Unity 4.3.3 running iOS7.
     
  4. Finjitzu

    Finjitzu

    Joined:
    Sep 8, 2011
    Posts:
    160
    I'm using 4.2 fix2 I think I'll have to check when I get home. Happening on IOS6 with Iphone 5 and IOS7 with Ipod touch 5.

    amanset: So your solution was to just move the trigger down?
     
  5. Finjitzu

    Finjitzu

    Joined:
    Sep 8, 2011
    Posts:
    160
    So I'm using 4.2.1f4, I'm just going to lower the GUI slightly on IOS devices I guess. Kinda weird though.
     
  6. amanset

    amanset

    Joined:
    Oct 19, 2013
    Posts:
    11
    Well down or up, depending if it was the bottom or top of the screen. Basically move the collider for the off screen border a few pixels away from the edge of the screen (but away from the screen, not onto the screen).

    This may or may not solve your issue, but it would be my first port of call. Find out if any touch is being registered and if it is find out what it is touching. I also moved my touches from the rather simple "GetMouseButtonDown()" in a script on the GameObject (which works these days with Touch) to the older-style raycast and finding what GameObject the ray hits.
     
  7. Finjitzu

    Finjitzu

    Joined:
    Sep 8, 2011
    Posts:
    160
    Yeah I'm using the OnClick function for the buttons on the top. For the buttons on the bottom I'm using this VCTouchController from the asset store. I should just probably switch it all to use NGUI functions, GetMouseButtonDown(), or use raycasts as you suggest. It's probably going to look weird to have the UI so far from the edge. Never ran into anything like this while testing on Android. Oh well, thanks for the help!