RaycastVisualization
RaycastVisualization copied to clipboard
This asset allows users to view raycasts as the user fires them.

This asset allows users to view raycasts as the user fires them.
Supports both the 2D and 3D api.
Usage
To get a visual to show up for a physics call simply do the following:
For 3D:
- Replace
Physics.withVisualPhysics..
For 2D:
- Replace
Physics2D.withVisualPhysics2D.. - Some 2D functions rely more on a 3D perspective in the editor depending on the orientation of the casts.
Installation
Using Unity Package Manager
- Open the Package Manager from
Window/Package Manager - Click the '+' button in the top-left of the window
- Click 'Add package from git URL'
- Provide the URL of this git repository: https://github.com/nomnomab/RaycastVisualization.git
- Click the 'add' button
User Options
The user options are located under Edit/Preferences/RaycastVisualization

Examples
3D API (click to expand)
Raycast / Linecast
RaycastAll / RaycastNonAlloc
CapsuleCast
CapsuleCastAll / CapsuleCastNonAlloc
CheckCapsule
OverlapCapsule / OverlapCapsuleNonAlloc
BoxCast
BoxCastAll / BoxCastNonAlloc
CheckBox
OverlapBox / OverlapBoxNonAlloc
SphereCast
SphereCastAll / SphereCastNonAlloc
CheckSphere
OverlapSphere / OverlapSphereNonAlloc
Compute Penetration
Closest Point
2D API (click to expand)
Raycast
RaycastAll / RaycastAll / RaycastNonAlloc
CapsuleCast
CapsuleCastAll / CapsuleCastAll / CapsuleCastNonAlloc
OverlapCapsule
OverlapCapsuleAll / OverlapCapsuleNonAlloc
BoxCast
BoxCastAll / BoxCastAll / BoxCastNonAlloc
OverlapBox
OverlapBoxAll / OverlapBoxNonAlloc
CircleCast
CircleCastAll / CircleCastAll / CircleCastNonAlloc
OverlapCircle
OverlapCircleAll / OverlapCircleNonAlloc
OverlapPoint
OverlapPointAll / OverlapPointNonAlloc
OverlapArea
OverlapAreaAll / OverlapAreaNonAlloc
OverlapCollider
Closest Point
Distance
GetContacts
GetContacts (points)
IsTouching
IsTouchingLayers
GetRayIntersection
GetRayIntersectionAll / GetRayIntersectionNonAlloc