do align to normal fix on relative to parent guy as well

This commit is contained in:
JohnCorby 2022-11-09 14:50:53 -08:00
parent 8af38577ed
commit 41571af86d

View File

@ -202,7 +202,7 @@ namespace NewHorizons.Builder.Props
if (detail.alignToNormal)
{
// Apply the rotation after aligning it with normal
var up = prop.transform.parent.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 *= rot;
}