mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Fix removeComponents
This commit is contained in:
parent
e27455bfb1
commit
23e245ff82
@ -58,7 +58,13 @@ namespace NewHorizons.Builder.Props
|
||||
var newDetailGO = new GameObject(detailGO.name);
|
||||
newDetailGO.transform.position = detailGO.transform.position;
|
||||
newDetailGO.transform.parent = detailGO.transform.parent;
|
||||
foreach(Transform child in detailGO.transform.GetComponentsInChildren<Transform>())
|
||||
// Can't modify parents while looping through children bc idk
|
||||
var children = new List<Transform>();
|
||||
foreach(Transform child in detailGO.transform)
|
||||
{
|
||||
children.Add(child);
|
||||
}
|
||||
foreach(var child in children)
|
||||
{
|
||||
child.parent = newDetailGO.transform;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user