5 minutes
Marks on the Hull
Deaths look right now. Everything short of a death still doesn't. You put two rounds into a fighter's left wing, the wing reaches zero HP, spaceshooter.part.destroyed fires, and the ship flies on, unmarked and symmetrical, with a wing that is destroyed only in an array somewhere.
This one needs something no component in the series has needed yet.
Engine code that ships with the component
Cutting a wing off a loaded GLB means finding the child mesh named -lwing under that ship's root, detaching it from its parent without moving it, revealing it, and animating it away. Every one of those is a Babylon call, and the rule that has held for three courses is that a component never imports @babylonjs.
The rule doesn't bend. Instead the engine code moves, into an adapter/ folder inside the component, shipped with it, registered at bootstrap. The component declares what it needs done as an interface:
The System looks that extension up on the adapter by name and calls it. Nothing found is a valid state, not an error: under the mock adapter, in a headless render, or on an engine with no plugin written yet, damage leaves no marks and everything else keeps working.
Continue reading
Unlock the Full Course
Every lesson, the runnable examples, and the finished build — yours to keep.