Эх сурвалжийг харах

修复龙卷扇越边缘速度越快的问题

WGL 1 сар өмнө
parent
commit
8bbf9db76d

+ 2 - 1
ActionTowerDefense/Assets/Scripts/Conduct/TornadoFan.cs

@@ -121,7 +121,8 @@ public class TornadoFan : AttackTrigger
                 {
                     lerpValue = lerpValueMin;
                 }
-                moveCharacter.transform.position = Vector3.Lerp(nowPos, targetPoss[i], lerpValue * Time.deltaTime);
+                //moveCharacter.transform.position = Vector3.Lerp(nowPos, targetPoss[i], lerpValue * Time.deltaTime);
+                moveCharacter.rb.velocity = (targetPoss[i] - nowPos).normalized * lerpValue;
                 //moveCharacter.transform.position = Vector3.Lerp(nowPos, targetPos, lerpValue * Time.deltaTime);
             }
         }