[Bug] [#457] Make scrolls use rotation parameter

This commit is contained in:
Nick 2022-12-12 18:21:48 -05:00
parent e4450e1129
commit d56a2f605f

View File

@ -271,7 +271,14 @@ namespace NewHorizons.Builder.Props
else customScroll.transform.position = planetGO.transform.TransformPoint(pos);
var up = planetGO.transform.InverseTransformPoint(customScroll.transform.position).normalized;
if (info.rotation != null)
{
customScroll.transform.rotation = Quaternion.Euler(info.rotation);
}
else
{
customScroll.transform.rotation = Quaternion.FromToRotation(customScroll.transform.up, up) * customScroll.transform.rotation;
}
customScroll.SetActive(true);