Fix rotation on stock planets

This commit is contained in:
Nick 2022-11-06 18:41:01 -05:00
parent 18f66f8701
commit aaa87cc858

View File

@ -130,7 +130,7 @@ namespace NewHorizons.Builder.Props
if (detail.alignToNormal) if (detail.alignToNormal)
{ {
// Apply the rotation after aligning it with normal // Apply the rotation after aligning it with normal
var up = go.transform.InverseTransformPoint(prop.transform.position).normalized; var up = (prop.transform.position - go.transform.position).normalized;
prop.transform.rotation = Quaternion.FromToRotation(Vector3.up, up); prop.transform.rotation = Quaternion.FromToRotation(Vector3.up, up);
prop.transform.rotation *= rot; prop.transform.rotation *= rot;
} }