1
2
3
4
5
6
while elapsed_time < moving_time:
unit.position = cur.lerp(next_pos, elapsed_time / moving_time)
elapsed_time += get_process_delta_time() * 1000
await get_tree().process_frame
unit.position = next_pos
cs


위처럼 코드를 짜서 유닛을 움직이고 있었는데

그냥 애니메이션으로 position 값을 움직이는 게 훨씬 간단하고 비선형적으로 움직이게 하기도 편하더라고?

가장 큰 장점은 정확한 시간에 맞게 움직이게 할 수 있는 거..

원래 그리드 움직임 같은 건 애니메이션 형식으로 처리하는 게 국룰 같은 건가?