Skip to content

v6.8.3 — mod-spawned parts were invisible in every build

Choose a tag to compare

@NeoXider NeoXider released this 29 Jul 07:29
· 101 commits to main since this release

The real fix for "mods spawn nothing in a build" — and a correction: 6.8.2 blamed the wrong cause.

Fixed

Parts spawned by mods were invisible in every player build. They were always there — active, correctly sized, collidable. They just drew nothing.

URP declares UniversalRenderPipelineAsset.defaultMaterial under #if UNITY_EDITOR, so in a player it returns null and GameObject.CreatePrimitive substitutes the built-in Default-Material (shader Standard). That material is not null — so a null check never caught it — and URP cannot render a built-in shader.

InstanceGameObjectBinder now builds its default material from the active pipeline's own shader whenever a Scriptable Render Pipeline is present, instead of trusting the primitive's material. Cylinders get it assigned explicitly, Universal Render Pipeline/Lit is in Always Included Shaders, and an unresolvable shader is now a loud error.

Correction to 6.8.2

That release attributed this to IL2CPP managed stripping and added link.xml entries. Measured on the live editor, Standalone builds with Mono2x and managed stripping Disabled — no managed stripping happens there at all, and the symptom reproduced identically on Mono and IL2CPP. Stripping could not have been the cause. The link.xml entries are kept, because they are correct and necessary for WebGL (which strips at Medium), but they fixed nothing here.

Added — the failure is no longer silent

A part that is created but never drawn is indistinguishable from one that was never created, and a player has no inspector to tell them apart. That is precisely why this bug survived a long debugging session.

  • The binder reports the first materialized part with its renderer and resolved shader — once, not per part, so a mod spawning in bulk cannot flood the console.
  • InstanceRegistry gained an engine-free Diagnostics hook that reports an instance entering a tree the registry does not own. That path was previously an early return: no log, no exception, no object.

Verification

Confirmed in an actual Windows player: parts render, and the shader resolves to Universal Render Pipeline/Lit (it read Standard before the fix). EditMode: 2427 tests, 0 failed.