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

Resolved Input position outside camera view

Discussion in 'Input System' started by Rickard87, Feb 27, 2022.

  1. Rickard87

    Rickard87

    Joined:
    Oct 12, 2021
    Posts:
    39
    I have been at it with getting letterboxing to work with my apps, and I have been successful at that now.
    I have searched and not found an answer to if I can use the letterboxed area for Input.
    What I want is the player to move if mouse position x is > 0 move right or < 0 move left.
    It would be nice for that area not to be useless but
    Vector3 mousePos2 = Camera.main.ScreenToWorldPoint(Input.mousePosition);
    doesn't work outside the cameraview, I guess since it is now an area outside the camera due to letterbox script

    Thanks for any response
     
  2. Rickard87

    Rickard87

    Joined:
    Oct 12, 2021
    Posts:
    39
    Hopefully this illustrates better what I mean.
    My game is made for 16:9 Portrait and use letterboxing.
    My phone is narrow so it cuts off the bottom. Which is what I want it to do.
    But can I use that cropped area to detect touch also?
     

    Attached Files:

  3. Rickard87

    Rickard87

    Joined:
    Oct 12, 2021
    Posts:
    39
    Is a solution to be using 2 cameras?
    But letterboxing has not worked for me while holding "native resolution". In fact all the ~5-10 scripts I've used has done absolutely nothing. The only solution I've found is let unity do it with 1.86 widescreen setting. And that seems to render all these scripts useless anyway