Updated to Godot 4.5 and func_godot 2025.9. Added grid_white and grid_taupe textures. Unfucked func_godot and navmesh settings. Began blocking out motel layout in map.
This commit is contained in:
@@ -20,7 +20,7 @@ var on_route : bool = false
|
||||
|
||||
@export var behavior_type : String = "guard"
|
||||
var state : String = "default"
|
||||
var current_waypoint : int = -1
|
||||
var current_waypoint : int = 0
|
||||
var paused : bool = false
|
||||
var pauseanim : String
|
||||
var pauseturn : bool
|
||||
@@ -226,7 +226,7 @@ func movement_process(delta):
|
||||
if !paused:
|
||||
walk_toward(current_path_point)
|
||||
|
||||
if global_transform.origin.distance_to(current_path_point) <= 0.5:
|
||||
if global_transform.origin.distance_to(current_path_point) <= 0.25:
|
||||
current_path_index += 1
|
||||
if current_path_index >= current_path.size():
|
||||
if on_route:
|
||||
@@ -265,9 +265,10 @@ func angle_toward(target : Vector3):
|
||||
return (Vector2(target.z, target.x) - Vector2($CharacterArmature.global_transform.origin.z, $CharacterArmature.global_transform.origin.x)).angle()
|
||||
|
||||
func walk_toward(point: Vector3):
|
||||
var direction = global_transform.origin.direction_to(point)
|
||||
var direction = global_transform.origin.direction_to(point)
|
||||
velocity.x = direction.x * walk_speed
|
||||
velocity.z = direction.z * walk_speed
|
||||
print(direction)
|
||||
|
||||
lerp_toward(atan2(velocity.x, velocity.z))
|
||||
|
||||
@@ -289,7 +290,8 @@ func setpath(target_position):
|
||||
target_position,
|
||||
true
|
||||
)
|
||||
path_end_point = current_path[len(current_path)-1]
|
||||
if len(current_path) > 0:
|
||||
path_end_point = current_path[len(current_path)-1]
|
||||
|
||||
func clearpath():
|
||||
current_path = []
|
||||
|
||||
Reference in New Issue
Block a user