Hi,
I realised that spherecastall have issues returning all collided objects along its path. I double checked using Raycastall, and raycast does provide me with the correct result. Anyone have encountered this issue as well?
Hi,
I realised that spherecastall have issues returning all collided objects along its path. I double checked using Raycastall, and raycast does provide me with the correct result. Anyone have encountered this issue as well?
The main difference I can think of is the size.
From the documentation:
Notes: SphereCastAll will not detect colliders for which the sphere overlaps the collider. The sphere cast does not work against colliders configured as triggers. If you move colliders from scripting or by animation, there needs to be at least one FixedUpdate executed so that the physics library can update it’s data structures, before a sphere cast will hit the collider at it’s new position.
The first part mentions that it will not detect colliders that overlap the sphere. That means, say the sphere radius is 5, and the distance between the cast origin and the object is 3, it will not return, because from the beginning it overlaps the sphere. On the other hand, the ray has no size, so it does not overlap the object which is 3 meters away. So it will return it.
There was a bug reported on both 4.6 and 5.0 where the 2D box/circle cast methods miss contacts. I have fixed this and it will be available in the next available patch release for both of these releases.