Skip to content

Instantly share code, notes, and snippets.

@codorizzi
Created June 4, 2021 06:15
Show Gist options
  • Save codorizzi/089c5826999450be2a7cd4d11f156b07 to your computer and use it in GitHub Desktop.
Save codorizzi/089c5826999450be2a7cd4d11f156b07 to your computer and use it in GitHub Desktop.
Rough draw spherecast debug code using lines
public static void DrawSphereCast(Vector3 origin, float radius, Color color, float duration = 0.1f) {
for(int x = -1; x < 2; x++)
for(int y = -1; y < 2; y++)
for (int z = -1; z < 2; z++) {
Vector3 end = origin + new Vector3(x, y, z) * radius;
Debug.DrawLine(origin, end, color, duration);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment