Ship render: the hull collider carries the invisible material, so clones draw nothing
forceRenderingOff is not serialized, so Instantiate and SaveAsPrefabAsset dropped it and every cloned mod ship (and every FBX-built prefab) drew its collision hull. The collider renderer now takes the template's invisible material, as the thruster emitter does. The preview smoke checks the collider on the clone and the prefab smoke checks it on the configured prefab. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
80de88f267
commit
fc73d7abcd
4 changed files with 15 additions and 3 deletions
|
|
@ -160,7 +160,8 @@ public static class ShipPrefabAuthoring
|
|||
mapIcon.gameObject.layer = minimapLayer;
|
||||
hull.gameObject.layer = combatLayer;
|
||||
var hullRenderer = hull.GetComponent<MeshRenderer>();
|
||||
if (hullRenderer != null) hullRenderer.forceRenderingOff = true;
|
||||
// Serialized, so it survives SaveAsPrefabAsset and every clone; forceRenderingOff survives neither.
|
||||
if (hullRenderer != null) ShipModShips.Hide(hullRenderer, invisible);
|
||||
var collider = AddOrGet<MeshCollider>(hull.gameObject);
|
||||
collider.sharedMesh = hullMesh;
|
||||
collider.convex = true;
|
||||
|
|
|
|||
Loading…
Reference in a new issue