mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
fixed bug with wall text not rotating around its normal properly
This commit is contained in:
parent
a13b790145
commit
b62db562f0
@ -170,8 +170,11 @@ namespace NewHorizons.Builder.Props
|
||||
var up = (nomaiWallTextObj.transform.position - planetGO.transform.position).normalized;
|
||||
var forward = planetGO.transform.TransformDirection(info.normal).normalized;
|
||||
|
||||
nomaiWallTextObj.transform.up = up;
|
||||
nomaiWallTextObj.transform.forward = forward;
|
||||
|
||||
var desiredUp = Vector3.ProjectOnPlane(up, forward);
|
||||
var zRotation = Vector3.SignedAngle(nomaiWallTextObj.transform.up, desiredUp, forward);
|
||||
nomaiWallTextObj.transform.RotateAround(nomaiWallTextObj.transform.position, forward, zRotation);
|
||||
}
|
||||
if (info.rotation != null)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user