Allow computers to align to a given normal

This commit is contained in:
Nick 2022-05-11 20:36:31 -04:00
parent c648fbe428
commit 09a24844e8
2 changed files with 2 additions and 1 deletions

View File

@ -161,6 +161,7 @@ namespace NewHorizons.Builder.Props
computerObject.transform.localPosition = info?.position ?? Vector3.zero;
var up = computerObject.transform.position - go.transform.position;
if (info.normal != null) up = go.transform.TransformDirection(info.normal);
computerObject.transform.rotation = Quaternion.FromToRotation(Vector3.up, up) * computerObject.transform.rotation;
var computer = computerObject.GetComponent<NomaiComputer>();

View File

@ -936,7 +936,7 @@
},
"normal": {
"$ref": "#/$defs/vector3",
"description": "The normal vector for this object. Only used for writing on walls to orient it properly."
"description": "The normal vector for this object. Used for writing on walls and positioning computers."
},
"rotation": {
"$ref": "#/$defs/vector3",