RaycastVisualization icon indicating copy to clipboard operation
RaycastVisualization copied to clipboard

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

Banner

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. with VisualPhysics..

For 2D:

  • Replace Physics2D. with VisualPhysics2D..
  • Some 2D functions rely more on a 3D perspective in the editor depending on the orientation of the casts.

Installation

Using Unity Package Manager

  1. Open the Package Manager from Window/Package Manager
  2. Click the '+' button in the top-left of the window
  3. Click 'Add package from git URL'
  4. Provide the URL of this git repository: https://github.com/nomnomab/RaycastVisualization.git
  5. Click the 'add' button

User Options

The user options are located under Edit/Preferences/RaycastVisualization

Settings

Examples

3D API (click to expand)

Raycast / Linecast

raycast

RaycastAll / RaycastNonAlloc

raycast_all

CapsuleCast

capsulecast

CapsuleCastAll / CapsuleCastNonAlloc

capsulecast_all

CheckCapsule

check_capsule

OverlapCapsule / OverlapCapsuleNonAlloc

overlap_capsule

BoxCast

boxcast

BoxCastAll / BoxCastNonAlloc

boxcast_all

CheckBox

check_box

OverlapBox / OverlapBoxNonAlloc

overlap_box

SphereCast

spherecast

SphereCastAll / SphereCastNonAlloc

spherecast_all

CheckSphere

check_sphere

OverlapSphere / OverlapSphereNonAlloc

overlap_sphere

Compute Penetration

compute_penetration

Closest Point

closest_point
2D API (click to expand)

Raycast

raycast

RaycastAll / RaycastAll / RaycastNonAlloc

raycast_all

CapsuleCast

capsulecast

CapsuleCastAll / CapsuleCastAll / CapsuleCastNonAlloc

capsulecast_all

OverlapCapsule

overlap_capsule

OverlapCapsuleAll / OverlapCapsuleNonAlloc

overlap_capsule_all

BoxCast

boxcast

BoxCastAll / BoxCastAll / BoxCastNonAlloc

boxcast_all

OverlapBox

overlap_box

OverlapBoxAll / OverlapBoxNonAlloc

overlap_box_all

CircleCast

circlecast

CircleCastAll / CircleCastAll / CircleCastNonAlloc

circlecast_all

OverlapCircle

overlap_circle

OverlapCircleAll / OverlapCircleNonAlloc

overlap_circle_all

OverlapPoint

overlap_point

OverlapPointAll / OverlapPointNonAlloc

overlap_point_all

OverlapArea

overlap_area

OverlapAreaAll / OverlapAreaNonAlloc

overlap_area_all

OverlapCollider

overlap_collider

Closest Point

closest_point

Distance

distance

GetContacts

get_contacts

GetContacts (points)

get_contacts_points

IsTouching

is_touching

IsTouchingLayers

is_touching_layers

GetRayIntersection

get_ray_intersection

GetRayIntersectionAll / GetRayIntersectionNonAlloc

get_ray_intersection_all