Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
L
ldefense
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages
Packages
Container Registry
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Gavin An
ldefense
Commits
c675f866
Commit
c675f866
authored
Jul 16, 2026
by
Gavin An
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
유닛의 배치 방법 변경 전
parent
ae4c3827
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
src/entities/units/base_unit.gd
src/entities/units/base_unit.gd
+13
-1
No files found.
src/entities/units/base_unit.gd
View file @
c675f866
...
...
@@ -90,7 +90,7 @@ func _physics_process(delta: float) -> void:
if
dist
>
chase_threshold
:
_target_monster
=
null
if
_is_moving
and
_
nav_agent
.
target_position
:
if
_is_moving
and
_
has_reached_manual_move_target
()
:
_is_moving
=
false
# 2. 적 자동 탐색 (타겟이 없고 수동 강제 이동 방지 쿨다운이 완료, 공격 쿨다운이 끝난 경우)
...
...
@@ -192,6 +192,17 @@ func _navigate_to_target(_delta: float) -> void:
if
current_pos
.
distance_to
(
next_path_pos
)
>
0.2
:
_look_at_target
(
next_path_pos
)
## 수동으로 찍은 이동 지점에 도착했는지 확인합니다.
## - 이동 중에는 자동 타겟 탐색을 막고, 목적지에 충분히 가까워졌을 때만 다시 탐색을 허용합니다.
func
_has_reached_manual_move_target
()
->
bool
:
if
_nav_agent
.
is_navigation_finished
():
return
true
var
target_pos
:
Vector3
=
_nav_agent
.
target_position
var
current_xz
:
Vector2
=
Vector2
(
global_position
.
x
,
global_position
.
z
)
var
target_xz
:
Vector2
=
Vector2
(
target_pos
.
x
,
target_pos
.
z
)
return
current_xz
.
distance_to
(
target_xz
)
<=
_nav_agent
.
target_desired_distance
## 타겟을 부드럽게(또는 수평 기준) 바라보게 회전
func
_look_at_target
(
target_pos
:
Vector3
)
->
void
:
var
look_target
:
Vector3
=
Vector3
(
target_pos
.
x
,
global_position
.
y
,
target_pos
.
z
)
...
...
@@ -356,6 +367,7 @@ func _set_melee_move_lock_until_hit(damage_delay: float) -> void:
## 외부에서 호출하는 특정 몬스터 강제 공격 지정
func
attack_target
(
monster
:
Node3D
)
->
void
:
_is_holding
=
false
# 강제 공격 시 홀드 해제
_is_moving
=
false
_has_queued_move_after_attack
=
false
if
is_instance_valid
(
monster
)
and
not
monster
.
get
(
"is_dead"
):
_target_monster
=
monster
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment