|Topic was automatically imported from the old Question2Answer platform.
I have a spaceship RigidBody2D that moves towards a player RigidBody2D but I need the spaceship to avoid the planet RigidBody2Ds using pathfinding.
The issue with using TileMap is that each tile is static and stationary while I planned the planet RigidBody2Ds to move via physics process. Furthermore, I don’t think there is a way to tile a rigid body anyway.
I don’t think using Navigation2D node with NavigationPolygonInstance will work as well since it only allows pathing defined in areas indicated by NavigationPolygonInstance. Obstacles are free-moving rigid bodies and in confined area.
I have included an image that gives a clearer picture. I’ve been scratching my head over this and I would be thankful if a step in the right direction is given.
NavigationMesh dynamic obstacle detection · Issue #3130 · godotengine/godot · GitHub maybe one day.
As of now I’d suggest using waypoints by having 4 points/areas around the planet. As the ship gets nearer to the planet find the nearest waypoint and then find the next waypoint depending on which way the ship is facing, after that it should’ve navigated around the planet enough to follow the player again.
Magso | 2020-01-01 20:03