godotengine / godotengine/godot-docs
Documentation for AStarGrid2D set_point_solid() is misleading, especially regarding "no need to call update()"
- Dominant language
- reStructuredText
- Stars
- 5.7k
- Forks
- 3.8k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 25
Description
**Your Godot version:**
4.2
**Issue description:**
While working with AStarGrid2D I noticed two issues with the documentation on the "AStarGrid2D" node:
1. The "Set_Point_Solid()" call documentation has a note at the end that says "update() is not needed after the call of this function":
> Disables or enables the specified point for pathfinding. Useful for making an obstacle. By default, all points are enabled.
Note: Calling [update](https://docs.godotengine.org/en/stable/classes/class_astargrid2d.html#class-astargrid2d-method-update) is not needed after the call of this function.
However, the "update()" call notes this:
> Note: All point data (solidity and weight scale) will be cleared.
So, if you call update(), not only is it not needed, but it will clear all points set to solid.
2. More minor, but the wording around set_point_solid() is a bit confusing, as it mentions that "by default, all points are enabled", which combined with the 2nd parameter in "set_point_solid()" it kind of leads users to believe that the default state of navigation tiles is "solid = true", thus, to set a point solid, it should be set to "false".
Let me know if there's any further questions, but I just had a bunch of issues with this on the Godot forums here debugging an issue, and both of us were confused debugging this, so wanted to fix this up!
tl;dr, my recommendations are:
1. Change the "Calling update is not needed after the call of this function" to "Calling update after this function will reset all points to solid = false"
2. Change the set_point_solid() documentation **from:** Disables or enables the specified point for pathfinding. Useful for making an obstacle. By default, all points are enabled. **to:** Disables or enables the specified point for pathfinding. Useful for making an obstacle. By default, all points are set to solid = true".
Suggestions or specifics can be adjusted of course, I just wanted to note this potential issue!
Thanks,
**URL to the documentation page:**]
https://docs.godotengine.org/en/stable/classes/class_astargrid2d.html
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.