Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | chrisme |
I’ve read into and am basically using a setup as suggested similar to 2D navigation overview — Godot Engine (latest) documentation in English including Avoidance and setting the (safe) velocity in the computed callback:
func _on_navigation_agent_2d_velocity_computed(safe_velocity: Vector2) -> void:
set_velocity(safe_velocity)
move_and_slide()
It all works so far, but when sending multiple Units (that have NavigationAgent2D’s) to the same target location, they “fight” for the destination place and push each other around endlessly.
I can understand why this happens, but can’t figure out a good way to implement a “group behaviour”.
What I want would basically be an RTS style group command resulting in units moving towards the destination, but stopping if another unit /navagent2d is already at standing at this (or surrounding) location.
Any suggestions on how to do this?
Thanks!