Godot Version
4.3
Question
So im trying to make a vampire survivors like game and I have each enemy with a NavigationAgent2D node. however when a bunch of enemies are attempting to target a point on the player they all group up and get stuck, likely waiting on other enemies to move first.
Note that all enemies do not collide with each other.
there is also no player sprite here. just note the player is on the center of the screen
Without source code, I don’t know how to help you.
You can try increasing or decreasing the collision body.
While yes the enemies do have collision the enemies themselves are set to not even collide with each other so increasing or decreasing it will not change anything.
but if its of any assistance here’s some of the relevant code related to pathing and moving and parameters for the NavigationAgent2D
func _physics_process(delta: float) -> void:
if _current_path == null: _current_path = $NavigationAgent2D.get_next_path_position()
if TARGET == null: locateTarget()
localDelta = delta
$NavigationAgent2D.target_position = TARGET.position
func _on_navigation_agent_2d_velocity_computed(safe_velocity: Vector2) -> void:
if TARGET == null: locateTarget()
if safe_velocity != Vector2.ZERO: velocity = safe_velocity
if !$NavigationAgent2D.is_target_reached() && localDelta != null:
move_and_slide()
path((_current_path - global_position).normalized() * MAX_SPEED)
func path(dir) -> void:
velocity = velocity.move_toward(dir, 1)