Răsfoiți Sursa

Fix Jack looking in weird direction if teleporting to above or below.

Lasse Öörni 12 ani în urmă
părinte
comite
be060dfb8a

+ 1 - 1
Bin/Data/LuaScripts/15_Navigation.lua

@@ -229,7 +229,7 @@ function SetPathPoint()
         if input:GetQualifierDown(QUAL_SHIFT) then
             -- Teleport
             currentPath = {}
-            jackNode:LookAt(pathPos, Vector3(0.0, 1.0, 0.0))
+            jackNode:LookAt(Vector3(pathPos.x, jackNode.position.y, pathPos.z), Vector3(0.0, 1.0, 0.0))
             jackNode.position = pathPos;
         else
             -- Calculate path from Jack's current position to the end point

+ 1 - 1
Bin/Data/Scripts/15_Navigation.as

@@ -231,7 +231,7 @@ void SetPathPoint()
         {
             // Teleport
             currentPath.Clear();
-            jackNode.LookAt(pathPos, Vector3(0.0f, 1.0f, 0.0f));
+            jackNode.LookAt(Vector3(pathPos.x, jackNode.position.y, pathPos.z), Vector3(0.0f, 1.0f, 0.0f));
             jackNode.position = pathPos;
         }
         else

+ 1 - 1
Source/Samples/15_Navigation/Navigation.cpp

@@ -282,7 +282,7 @@ void Navigation::SetPathPoint()
         {
             // Teleport
             currentPath_.Clear();
-            jackNode_->LookAt(pathPos, Vector3(0.0f, 1.0f, 0.0f));
+            jackNode_->LookAt(Vector3(pathPos.x_, jackNode_->GetPosition().y_, pathPos.z_), Vector3(0.0f, 1.0f, 0.0f));
             jackNode_->SetPosition(pathPos);
         }
         else