Outer-Wilds-New-Horizons / new-horizons

A tool for modifying or creating new planets, dialogue, ship logs, and more for Outer Wilds.
https://nh.outerwildsmods.com/
MIT License
42 stars 15 forks source link

Fix sectors being rotated on tidally locked bodies #870

Closed MegaPiggy closed 1 month ago

MegaPiggy commented 1 month ago

Bug fixes

MegaPiggy commented 1 month ago

Setting .parent = keeps the old world position and rotation. I changed it to .SetParent(parentTransform, false); to not keep the world position and instead keep local position/rotation which is 0 for both since it is a new gameobject.

Since tidally locked bodies change the rotation of the body to face the parent before the sector is created, you would get problems where the props and everything would not be in the same places as they are without being tidally locked.