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.
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
A list of the supported visualizations for modules and there calls are listed below:
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.
Below a description what will be shown as visualization for the cast and overlaps.
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.
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.
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.
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
This package includes two sample scenes for testing purposes:
Contains all types of casts and overlap test from the physics module.
Contains all types of casts and overlap test from the physics2d module.
This version of Cast Visualizer is compatible with the following versions of the Unity Editor:
2018.4 or higher (recommended)
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.