瀏覽代碼

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

WGL 1 月之前
父節點
當前提交
8bbf9db76d
共有 1 個文件被更改,包括 2 次插入1 次删除
  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);
             }
         }