Advertisement
LittleAngel

Untitled

Mar 28th, 2011
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1. (Open) SphereCast and all related pages are confusing
  2.  
  3.  
  4. 1) What happened
  5. SphereCast and all related pages are confusing.
  6. http://unity3d.com/support/documentation/ScriptReference/Physics.SphereCast.html
  7.  
  8. This is what's in the documentation:
  9. -
  10. Description
  11. Casts a sphere against all colliders in the scene and returns detailed information on what was hit.
  12. This is useful when a Raycast does not give enough precision, because you want to find out if an object of a specific size, such as a character, will be able to move somewhere without colliding with anything on the way. Think of the sphere cast like a thick raycast.
  13. -
  14.  
  15. We had a long conversation about casting and the confusion in the documentation and there is one fundamental misunderstanding about how these volume casts work that is not addressed in the docs. This is also related to what the user's expectations are.
  16.  
  17. Most users come across SphereCast and don't understand it because they feel that SphereCasting should be "like a ray" but casting out in a sphere around the origin - Like OverlapSphere but instead of returning Collider[] is returns RaycastHit[].
  18.  
  19. This is not true, tho' people try to use it like this.
  20.  
  21. SphereCast moves a Sphere volume down the direction and distance of a ray and detects what it bumps into.
  22.  
  23. The following description "Casts a sphere against all colliders in the scene ..." in under descriptive and confusing.
  24.  
  25. This needs to be something like "Casts a sphere (radius) along a ray (origin, direction, distance) and returns an array containing detailed information on each collider which was hit by the sphere while traveling along the ray.
  26.  
  27. If you google/search "SphereCast" on the forums and answers, you will see that many (most?) people don't understand SphereCast and are using it improperly.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement