From a7939ef5f4b0854ae2bd75690945a20adcf86f5f Mon Sep 17 00:00:00 2001 From: unknown <john.schihada@hotmail.com> Date: Tue, 7 Jan 2020 12:54:24 +0100 Subject: [PATCH] =?UTF-8?q?Fixed=20the=20Orientation-Problem=20of=20the=20?= =?UTF-8?q?AngleGO.=20Problem=20was:=20Vector3.Angle()=20returns=20only=20?= =?UTF-8?q?an=20Angle=20<=3D=20180=C2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/InteractionEngine/FactSpawner.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/InteractionEngine/FactSpawner.cs b/Assets/InteractionEngine/FactSpawner.cs index fc73466b..80bb0af4 100644 --- a/Assets/InteractionEngine/FactSpawner.cs +++ b/Assets/InteractionEngine/FactSpawner.cs @@ -158,7 +158,7 @@ public void SpawnAngle(AngleFact angleFact) //Rotate so that the rotation points from point2 to the middle of point3 and point1 angle.transform.GetChild(0).rotation = Quaternion.FromToRotation(Vector3.right, (Vector3.Lerp((tempPoint1 - point2).normalized, (tempPoint3 - point2).normalized, 0.5f))); //Now the rotation around that direction must also be adjusted - angle.transform.GetChild(0).RotateAround(point2, (Vector3.Lerp((tempPoint1 - point2).normalized, (tempPoint3 - point2).normalized, 0.5f)), Vector3.Angle(angle.transform.GetChild(0).forward.normalized, (tempPoint3 - tempPoint1).normalized)); + angle.transform.GetChild(0).RotateAround(point2, (Vector3.Lerp((tempPoint1 - point2).normalized, (tempPoint3 - point2).normalized, 0.5f)), Vector3.Angle(angle.transform.GetChild(0).forward.normalized, (tempPoint1 - tempPoint3).normalized)); string letter = ((Char)(64 + angleFact.Id + 1)).ToString(); angle.GetComponentInChildren<TextMeshPro>().transform.localPosition = new Vector3((0.5f * tempProjection).x, angle.GetComponentInChildren<TextMeshPro>().transform.localPosition.y, (0.5f * tempProjection).z); -- GitLab