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
  4. Dismiss Notice

[RELEASED] Mobile Touch Camera

Discussion in 'Assets and Asset Store' started by BitBenderGames, Sep 2, 2015.

  1. BitBenderGames

    BitBenderGames

    Joined:
    Aug 9, 2015
    Posts:
    71
    Hello. Thanks for the suggestion. I will look into this. This may sound like a copy/paste answer, but I assure you it's not ;-)

    Cheers
     
  2. BitBenderGames

    BitBenderGames

    Joined:
    Aug 9, 2015
    Posts:
    71
    Alright. Matter of fact is that your suggestion almost works out of the box, but isn't explicitly mentioned in the FAQs section. I vaguely remember not promoting this solution more prominently because sometimes a text element that doesn't even have any content can block large parts of the screen with its Raycast Target.

    That said, all you need to do in my asset is to add the script called DisableInputOnAllUI (found under mobile_touch_camera/scripts/tools) on a MonoBehaviour and it will basically block touches on all Unity UI elements that have the Raycast Target flag set to true. Cheers.
     
  3. NenadNikolicTech

    NenadNikolicTech

    Joined:
    Jun 22, 2021
    Posts:
    7
    Hey I keep getting an error
    Failed to compute intersection between camera ray and reference plane. Make sure the camera Axes are set up correctly
     
  4. BitBenderGames

    BitBenderGames

    Joined:
    Aug 9, 2015
    Posts:
    71
    Hello. I just sent you a PM. Regards
     
  5. NenadNikolicTech

    NenadNikolicTech

    Joined:
    Jun 22, 2021
    Posts:
    7
    Hey sorry, like I wrote in PM, problem was camera too low compared to terrain.
     
  6. BirchMedia

    BirchMedia

    Joined:
    Jan 29, 2016
    Posts:
    1
    Hi! I can't adjust two cameras with your script. So the problem is: if we have Main camera and Overlay camera with pickable script, objects moves with first camera only. Can you explain, how I can use it with Overlay mode?
     
  7. BitBenderGames

    BitBenderGames

    Joined:
    Aug 9, 2015
    Posts:
    71
    Hello. So you want to pick items both in the Main Camera and in the Overlay Camera, or just in the Overlay Camera? The Main Camera is still used exclusively for scrolling around?

    While I'm trying to understand your use-case better, I will have to say that it's probably not doable out of the box and potentially difficult to implement into this package. That said, if we cannot achieve what you need for your project, please send me a PM so we can discuss a refund.

    Cheers
     
  8. CompletelyUnprofessional

    CompletelyUnprofessional

    Joined:
    Nov 14, 2017
    Posts:
    3
    Hi!

    I have a small problem with manual zoom.
    Here's the situation.
    My world is basically a map. I want a camera to zoom in when user clicks on an objects on a map.

    So I use OnObjectPicked in MobileTouchCamera and it works as it should. Event is attached to my function, and here is the question: how to start manual zoom?

    I discovered ZoomToTargetValueCoroutine() which seems to do the trick both for zooming and unzooming.
    I use it like this:
    m_mobileTouchCamera.StartCoroutine(m_mobileTouchCamera.ZoomToTargetValueCoroutine(300f));

    It works fine, but here is the problem: for some reason unzooming changes position too. Position changes depending where I click right before I start unzooming. I assumed that when even OnObjectPicked is triggered, position of camera is not changed, but it seems it has some sort of influence on ZoomToTargetValueCoroutine() later.

    How can I avoid that? Am I missing something? ZoomToTargetValueCoroutine() is not documented, so I'm not sure if I use it correctly.

    There is also FocusCameraOnItem script, but it does not give me enough control over zooming and unzooming, it is sort of automatic. Using ZoomToTargetValueCoroutine does exactly what I need, except for moving camera all over the place.

    A little help, please.
     
  9. CompletelyUnprofessional

    CompletelyUnprofessional

    Joined:
    Nov 14, 2017
    Posts:
    3
    Also, I see there is a way to disable rotation and tilt.
    Is there a way to temporarily disable also panning (moving camera around) or a zoom? That would be useful.
     
  10. BitBenderGames

    BitBenderGames

    Joined:
    Aug 9, 2015
    Posts:
    71
    Hello. I just sent you a PM. Regards
     
  11. KinderAndry

    KinderAndry

    Joined:
    Nov 21, 2021
    Posts:
    1
  12. BitBenderGames

    BitBenderGames

    Joined:
    Aug 9, 2015
    Posts:
    71
    Hello. The asset is written using the old code-based input system, not the new one you linked to. Kind regards