From c27e2ed665b9507891c2197240a9b2028eb69c59 Mon Sep 17 00:00:00 2001 From: xen-42 Date: Sat, 5 Oct 2024 12:03:54 -0400 Subject: [PATCH] Update PlanetCreationHandler.cs --- NewHorizons/Handlers/PlanetCreationHandler.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NewHorizons/Handlers/PlanetCreationHandler.cs b/NewHorizons/Handlers/PlanetCreationHandler.cs index 599b212d..013443b5 100644 --- a/NewHorizons/Handlers/PlanetCreationHandler.cs +++ b/NewHorizons/Handlers/PlanetCreationHandler.cs @@ -813,8 +813,8 @@ namespace NewHorizons.Handlers if (referenceFrame != null) referenceFrame._attachedAstroObject = newAO; // QM and stuff don't have orbit lines - // Using the name since NH only creates the OrbitLine components next frame - var orbitLine = go.transform.Find("Orbit")?.gameObject; + // Using the name as well since NH only creates the OrbitLine components next frame + var orbitLine = go.GetComponentInChildren()?.gameObject ?? go.transform.Find("Orbit")?.gameObject; if (orbitLine != null) { UnityEngine.Object.Destroy(orbitLine);