Skip to content

Debug Draw Raycast Hit

Draw a RaycastHit in the Scene view using a hit marker and a normal line.

This action is helpful when you want to confirm exactly where a raycast landed and which direction the surface normal is pointing.

What It Does

Instead of drawing a single line, this action renders:

  • a small circle at the hit point
  • a separate line for the hit normal

If the action runs every frame, it uses a duration of 0 so the drawing refreshes continuously. When the state stops, it draws one last time using the full configured duration.

Parameters

Parameter Description
Raycast Hit The RaycastHit value to visualize.
Hit Color Color used for the hit marker.
Normal Color Color used for the normal line.
Duration How long the drawing should remain visible when not updating every frame.
Depth Test If enabled, the gizmo can be hidden behind other geometry.

Example

Use this action after a raycast to check whether the impact data looks correct:

  1. Store a raycast result in a RaycastHit variable.
  2. Add Debug Draw Raycast Hit in the same state.
  3. Assign the Raycast Hit variable.
  4. Choose contrasting colors for the hit marker and the normal.

Notes

  • Nothing is drawn if the RaycastHit does not contain a collider.
  • This action uses PlayMaker's debug drawing helpers rather than a direct single-call Unity wrapper.
  • It is especially useful when debugging ledge checks, ground checks, weapon hits, or line-of-sight tests.