gdquest-demos / godot-4-new-features

Free and open-source Godot 4 demo scenes to see the new features in action
MIT License
449 stars 45 forks source link

NavigationObstacle3D broken in Dynamic Avoidance demo? (GD4.1.1) #36

Closed wp2000x closed 1 year ago

wp2000x commented 1 year ago

Whatever i try, it just does not work.

https://github.com/gdquest-demos/godot-4-new-features/assets/70962730/8d40d8a5-6f94-4527-ac2e-8e54be342539

razcore-rad commented 1 year ago

Let us know if the problem is fixed for you, it seems we forgot to turn the avoidance back on when a new target position is given to the beetle.

wp2000x commented 1 year ago

@razcore-rad Thanks for the fast response! It seems to kinda work now, but sometimes it breaks apart? Example:

https://github.com/gdquest-demos/godot-4-new-features/assets/70962730/b3c4141b-741b-4be3-911e-5842d4921197

Also i noticed that there is an Navigation sync error in the demo.

E 0:00:01:0198   update_polygons: Navigation map synchronization error. Attempted to update a navigation region with a navigation mesh that uses a different `cell_height` than the `cell_height` set on the navigation map.
  <C++ Source>   modules/navigation/nav_region.cpp:122 @ update_polygons()

2023-07-25_19-38-24

razcore-rad commented 1 year ago

That angle is a bit difficult to notice if it does break apart or not. Remember that the avoidance isn't a super reliable method to begin with. If you read the docs it's mentioned as a last resort so it's pretty hard to get it to do what you want.

In the last clip you posted you can see the beetle does move around the ball, but then the ball continues through the beetle a bit, but at that point the agent has already passed it enough that it won't do any corrections.

The error you've noticed is probably something known (I haven't searched the Godot issues). It has to do with accessing the navigation server in the first few frames of the game play as you can see from the time stamp. It isn't relevant to the avoidance movement that happens later.