Cast Visualizer Manual


The Cast Visualizer is located in the top menu at Tools/BG Tools/Cast Visualizer. It’s a standard dockable window, so place it wherever it helps to be productive. All functions will be controlled from this window.

Cast visualizer window layout

The Cast Visualizer window displays:

  • (A) Toggle buttons to enable/disable the visualization
  • (B) Activate visualization for modules
  • (C) Customize colors
  • (D) Select the preferred cast volume visualization type

Usage

Provided visualizations

A list of the supported visualizations for modules and there calls are listed below:

Physics
• Linecast
• Raycast
• Boxcast
• CapsuleCast
• SphereCast
• CheckBox
• CheckSphere
• CheckCapsule
• OverlapBox
• OverlapSphere
• OverlapCapsule
Physics2D
• Linecast
• Raycast
• BoxCast
• CapsuleCast
• CircleCast
• OverlapBox
• OverlapCircle
• OverlapCapsule
• OverlapArea
• OverlapCollider
• OverlapPoint

Activate/Deactivate visualization

To activate/deactivate the visualization use the on/off buttons on top of the CastVisualizer window. This will show all casts and overlap tests that will be performed.

Visualizations

Below a description what will be shown as visualization for the cast and overlaps.

Casts

Cast will be visualized with their cast geometry at the origin and the max distance. The connection between them can be configured, see ‘Volume visualization types’.

The hits are shown by displaying the cast’s geometry at their location. Additionally the direct hit position will be marked with the cross indication if this data are available.

Overlaps

Get visualized over the overlap test geometry. All the overlapping colliders will be highlighted as hit.

Show in game view

To show the visualization in the game view activate it with the ‘Gizmos’ button, as shown in the following image. It is deactivated by default.

Game view window gizmos button

Customization

Customize the visualization as you like for your needs. The configuration can be found in the CastVisualizer window too. Below a description of what can be configured.

Select types to show

Control what kind of types are shown with checking the required modules to keep focus of what you’re working on.

Colors

Change the colors for the visualization of the module and the hits as you like.

Volume visualization types

Choose between two different types of visualizations for the cast volume:

  • Line - Displays the cast direction as line
  • Wired Body - Connects the edges of the cast volume

Volume visualization types

Samples

This package includes two sample scenes for testing purposes:

Physics

Contains all types of casts and overlap test from the physics module.

Physics2D

Contains all types of casts and overlap test from the physics2d module.

Technical details

Requirements

This version of Cast Visualizer is compatible with the following versions of the Unity Editor:

2018.4 or higher (recommended)

Limitations

The visualization is only displayed in the editor. The plugin uses editor functions to draw all the visualization and they are not available on published builds.

Casts use infinite distance by default. Due to limitations of debug rendering in the editor, it is not possible to visualize this. The plugin uses a fixed distance to show infinity casts. But the internal check is already infinity.