enemy now can walk on slopes
This commit is contained in:
parent
81d5c5f0ba
commit
eec69524ee
4 changed files with 35 additions and 20 deletions
|
@ -9,7 +9,7 @@ func _process(delta: float) -> void:
|
|||
if Engine.is_editor_hint():
|
||||
camera = EditorInterface.get_editor_viewport_3d().get_camera_3d()
|
||||
# Angle between camera's -basis.z (forward direction) and direction to camera
|
||||
var angle = vec3_to_vec2(-global_transform.basis.z).angle_to(vec3_to_vec2(global_position - camera.global_position)) + PI
|
||||
var angle = vec3_to_vec2(global_transform.basis.z).angle_to(vec3_to_vec2(global_position - camera.global_position)) + PI
|
||||
var chosen_index = 0
|
||||
for i in rotations.keys():
|
||||
if abs(angle-i) < abs(angle-chosen_index):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue