Skip to content

Commit ceb766d

Browse files
fix: incorrect offset positioning of custom multipart structures
1 parent 0bf7335 commit ceb766d

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

COTL_API/CustomStructures/CustomStructureManager.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ public static bool CustomStructureExists(string name)
4747
internal static GameObject CreateBuildingPart(CustomStructureBuildingData data)
4848
{
4949
var go = new GameObject("Part");
50-
go.transform.localPosition = data.Offset;
51-
go.transform.localScale = new Vector3(data.Scale.x, data.Scale.y, data.Scale.z);
52-
go.transform.localRotation = Quaternion.Euler(data.Rotation);
53-
5450
var sr = go.AddComponent<SpriteRenderer>();
5551
sr.sprite = data.Sprite;
5652

@@ -73,11 +69,14 @@ public static void OverrideStructureBuilding(GameObject existingStructure, List<
7369
if (sr.gameObject == existingStructure) continue;
7470
sr.gameObject.SetActive(false); //or destroy?
7571
}
76-
72+
7773
foreach (var part in buildingParts)
7874
{
7975
var partGO = CreateBuildingPart(part);
8076
partGO.transform.SetParent(buildingParent.transform);
77+
partGO.transform.localPosition = new Vector3(part.Offset.x, part.Offset.y, part.Offset.z);
78+
partGO.transform.localScale = new Vector3(part.Scale.x, part.Scale.y, part.Scale.z);
79+
partGO.transform.localRotation = Quaternion.Euler(part.Rotation);
8180
}
8281
}
8382
}

thunderstore.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ schemaVersion = "0.0.1"
44
[package]
55
namespace = "xhayper"
66
name = "COTL_API"
7-
versionNumber = "0.2.11"
7+
versionNumber = "0.2.12"
88
description = "A library to easily interact with Cult of the Lamb"
99
websiteUrl = "https://cotl-api.vercel.app/"
1010
containsNsfwContent = false

0 commit comments

Comments
 (0)