Closed Alex2782 closed 10 months ago
how to fix these errors?
You have trailing whitespace (tabs) in your code. I recommend enabling the Trim Trailing Whitespace on Save editor setting to get rid of them automatically :slightly_smiling_face:
If we rework and update the demo maybe we should save the NavigationPolygon resource to an external file as a binary .res file?
Right now it is stored embedded as plain text inside the navigation.tscn file, something that we should not teach to new users as it will bloat their scene files and make them super slow to load/save/update on large and complex navigation meshes.
@smix8
it's now an external file, but i forgot to configure properly to res
, it's now tres
(text), should we leave it like that? maybe better for github and debbugging? I don't know yet how to convert tres
to res
afterwards, does Godot already have a function for that?
Save as
, or convert to
function would perhaps be quite good in the context menu.
don't know yet how to convert tres to res afterwards
Click the "Make Unique" again and "Save As" then you can save it as a new .res binary file.
@smix8
The function set_movement_target
was already in the character-GDscript, but unused (copied from the doc)
I moved the character to its own scene and deleted navigation.gd.
now only one script character.gd
navigation_agent.debug_enabled = true
👍
I have combined the script from the documentation with the old solution (click event with red dot) https://docs.godotengine.org/en/latest/tutorials/navigation/navigation_introduction_2d.html#setup-for-2d-scene
https://github.com/godotengine/godot-demo-projects/assets/41921395/a21e9ab1-43e1-4c0b-820a-563a8ee23264
'NavigationPolygon' drawn again, it looked buggy.![image](https://github.com/godotengine/godot-demo-projects/assets/41921395/9669964e-a4b0-4800-bcda-71d1e65ebd94)