소스 검색

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

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