You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've got an object in my scene where I control it's size using setScale. I've also got a Collider on this object. I've found I'm having problems getting the pickers nearest object detection to work when this object is in front of another object with a Collider.
What I think is happening is that the calculated distance used to determine the nearest object is also getting mapped by the scale. So for instance if an object is 2 units away, and has a scale of 0.5, then the distance gets divided by 0.5 giving a total of 4, which is the effective distance allowing for scaling.
So if there's another object 3 units away with a normal scale of 1, this gets given a distance of 3 so the Picker thinks it's nearer and returns a hit on this object, not the scaled object that is actually closer.
The text was updated successfully, but these errors were encountered:
We had similar problem in our app. What we found out is that MeshCollider returns distance for raycast in mesh coordinates not in world (Sphere and Box colliders returns distance in world coordinates). I made quick fix in our fork #2033 but someone from core team should look into this issue.
I've got an object in my scene where I control it's size using setScale. I've also got a Collider on this object. I've found I'm having problems getting the pickers nearest object detection to work when this object is in front of another object with a Collider.
What I think is happening is that the calculated distance used to determine the nearest object is also getting mapped by the scale. So for instance if an object is 2 units away, and has a scale of 0.5, then the distance gets divided by 0.5 giving a total of 4, which is the effective distance allowing for scaling.
So if there's another object 3 units away with a normal scale of 1, this gets given a distance of 3 so the Picker thinks it's nearer and returns a hit on this object, not the scaled object that is actually closer.
The text was updated successfully, but these errors were encountered: