Instantiate inactive why not

This commit is contained in:
Nick 2023-07-13 20:30:41 -04:00
parent fbbaeb4fb6
commit d395a002cd

View File

@ -36,7 +36,8 @@ namespace NewHorizons.Builder.Body
var radius = module.radius; var radius = module.radius;
var newCloak = Object.Instantiate(_prefab, sector?.transform ?? planetGO.transform); var newCloak = _prefab.InstantiateInactive();
newCloak.transform.parent = sector?.transform ?? planetGO.transform;
newCloak.transform.position = planetGO.transform.position; newCloak.transform.position = planetGO.transform.position;
newCloak.transform.name = "CloakingField"; newCloak.transform.name = "CloakingField";
newCloak.transform.localScale = Vector3.one * radius; newCloak.transform.localScale = Vector3.one * radius;