Search Unity

Strange problem with Unity3 and Colliders

Discussion in 'Editor & General Support' started by roycdavies, Nov 20, 2010.

  1. roycdavies

    roycdavies

    Joined:
    Jul 13, 2009
    Posts:
    7
    I've just upgraded to Unity3, and now, one of the environments I have is experiencing oddities around onmouseover with collision detection on objects. It is bizarre, and I don't yet grasp what is happening or not.

    I have a GameObject that has a sphere collider, and a script that checks to see if the mouse enters and exits the object, and highlights it by changing it's colour when the mouse is over. Standard stuff, which is working fine on some objects, but others, which worked before upgrading to Unity3, now don't work.

    Another symptom is that if I increase the size of the sphere collider to much bigger, it does highlight, but not where I expect it to be on the screen. And yet other objects work fine.

    I also notice that mouse-collision detection doesn't seem to work at all in the Game window when it isn't maximized.

    I'm using Unity3 on the Mac.

    Any light that you feel could be shed on this would be most appreciated.
     
    Last edited: Nov 20, 2010
  2. roycdavies

    roycdavies

    Joined:
    Jul 13, 2009
    Posts:
    7
    OK, for what it's worth, I eventually narrowed down the problem. In that scene, I had two cameras, one normal, one orthographic. The Orthographic camera had a size of 0.9. When I removed that camera, the problem disappeared, and I was able to select and highlight all the objects as expected. When I added the camera again, the problem returned. Setting the size to 1 also fixed the problem. A small bug, perhaps? Would be interested to know if anybody else can reproduce this problem...

    /Roy.
     
  3. roycdavies

    roycdavies

    Joined:
    Jul 13, 2009
    Posts:
    7
    Actually that wasn't the problem either, it only started working when I turned of the camera with Orthographic view.