Browse Source

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

WGL 1 tháng trước cách đây
mục cha
commit
8bbf9db76d
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      ActionTowerDefense/Assets/Scripts/Conduct/TornadoFan.cs

+ 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);
             }
         }