Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Physics2DRaycaster and camera

Discussion in 'Physics' started by drHogan, Dec 18, 2014.

  1. drHogan

    drHogan

    Joined:
    Sep 26, 2012
    Posts:
    201
    Hi guys,

    I have a weird behavior with the Physics2DRaycaster attached to my main camera. My objects in the scene have a 2D collider attached and a script implementing IPointerClickHandler.

    When the camera (ortographic, planes all correct so that the are fits in) is zoomed out (size 340 and a bit less) as in this first picture. The tavern (small building between trees on upper left) and whatever other building i decide to build in that upper part don't react to the raycaster and i always receive the message that i am hitting the terrain on click.


    At the same level of zoom, if they are anywhere else in the map they cause no problem. When I zoom in (just changing the size of the camera and the x,y position in case, but not the distance from the scene) then, as in this picture here, i see that the area of "non raycasting" shrinks more and more until almost disappearing.



    I am going stupid in trying to figure out the problem, any idea?

    Best,
    H
     
  2. drHogan

    drHogan

    Joined:
    Sep 26, 2012
    Posts:
    201
    Might also be worth pointing out that eveything else works in that area, so if for example i want to build a tower there, i have no problem in building it, just i can't select it after!