Documenting the dark corners of the Unity Engine.

User Tools

Site Tools



This shows you the differences between two versions of the page.

Link to this comparison view

physics [2022/07/29 02:20] (current)
uninomiconadmin created
Line 1: Line 1:
 +====== Physics ======
 +==== Physics.CapsuleCast ====
 +==== Physics.CapsuleCastAll ====
 +CapsuleCast may sometimes return invalid an 'invalid hit', where ''hit.distance == 0'' and ''hit.point == (0,0,0)'' ((It's not documented for all casts, but it is documented for SphereCastAll: https://docs.unity3d.com/ScriptReference/Physics.SphereCastAll.html)). By the documentation, this should only happen when the starting cast position already overlaps a target geometry. 
 +Occasionally, however, CapsuleCast may return an invalid hit in certain uncommon but valid cases. For example, hitting a triangle mesh exactly edge on((ie. ''ray.direction == colliderTriangle.normal'')). Adding a small fudge value to the cast direction can alleviate this.
physics.txt ยท Last modified: 2022/07/29 02:20 by uninomiconadmin