Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Makes generated mesh colliders compatible with SuperCharacterController (
using UnityEngine;
using Sabresaurus.SabreCSG;
public static class BSPTreePostProcess
public static void OnPostProcessCSGBuild(Transform meshGroup)
if(meshGroup != null)
// Grab all the built mesh colliders
MeshCollider[] colliders = meshGroup.GetComponentsInChildren<MeshCollider>();
// Add a SuperCharacterController BSPTree to each collider
for (int i = 0; i < colliders.Length; i++)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment