MilosLukic / Godot-Navigation-Lite

Godot plug&play implementation of detour. It allows user to have multiple navigation meshes, fast cached obstacles, and realtime navmesh changes.
Other
132 stars 12 forks source link

Changing auto_add_remove_objects property at runtime has no effect #6

Open DonRomano opened 3 years ago

DonRomano commented 3 years ago

First of all, thank you for this addon. It's so much better that the standard Godot navigation!

It seems that auto_add_remove_objects property doesn't work at runtime. You can easily check it in the demo provided with the addon. Just add this simple 'if' statement to _process function in the Camera.gd script:

if Input.is_action_just_pressed("ui_accept"):
    $"../DetourNavigation".auto_add_remove_objects = not $"../DetourNavigation".auto_add_remove_objects
    print("Auto_add_remove_objects is now: ", $"../DetourNavigation".auto_add_remove_objects)

Now pressing space toggles the property so when it's off, adding a dynamic object should have no impact on navigation mesh. Unfortunately, event when it's off, the mesh is still updated. And of course when you turn it off in the editor before running the project, you cannot turn it on from the script. Is there something else I need to do to make it work?

MilosLukic commented 3 years ago

Thank you for the PR fix! Since I'm over my head in other projects I'm not currently able to do much work here. If you find any other bug or create a new feature, I'd be happy to help with reviewing and accepting PR. Especially since (as far as I know) Godot 4.0 wont have as proper navigation as it should have (RVO is physics based).