diff --git a/Runtime/ArenaMesh/ArenaMesh.cs b/Runtime/ArenaMesh/ArenaMesh.cs index 465f080..a849eba 100644 --- a/Runtime/ArenaMesh/ArenaMesh.cs +++ b/Runtime/ArenaMesh/ArenaMesh.cs @@ -9,6 +9,7 @@ namespace ArenaUnity public abstract class ArenaMesh : MonoBehaviour { protected MeshFilter filter; + protected MeshCollider mc; internal bool build = false; internal bool scriptLoaded = false; @@ -16,6 +17,8 @@ protected virtual void Start() { filter = GetComponent(); Build(filter); + mc = GetComponent(); + if (mc != null) mc.sharedMesh = filter.mesh; } protected abstract void Build(MeshFilter filter); @@ -40,6 +43,8 @@ protected void Update() if (build) { Build(filter); + mc = GetComponent(); + if (mc != null) mc.sharedMesh = filter.mesh; build = false; } }