Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add NavigationAgent2D/3D set_navigation_map() function #62044

Merged

Conversation

smix8
Copy link
Contributor

@smix8 smix8 commented Jun 14, 2022

Add NavigationAgent2D/3D set_navigation_map() and get_navigation_map() function to change maps with NavigationAgent Nodes as they do not react to changes on the abstract agent on the NavigationServer that are made with the API directly.

Fixes #62040

@smix8 smix8 requested review from a team as code owners June 14, 2022 18:42
@Calinou Calinou added this to the 4.0 milestone Jun 14, 2022
@Calinou Calinou added the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Jun 14, 2022
@smix8 smix8 force-pushed the navigation_navagent_map_change_4.x branch from 7a74690 to 331c1d5 Compare June 14, 2022 18:53
@fire-forge
Copy link
Contributor

fire-forge commented Jun 14, 2022

Since there is both a setter and a getter, this should probably be implemented as a property instead. It can be implemented as a non-editor property (PROPERTY_USAGE_NO_EDITOR) so that it's accessible from scripting but not in the inspector.

@smix8
Copy link
Contributor Author

smix8 commented Jun 14, 2022

Wouldn't a property require another dedicated variable as the getter can return something different when no override is set?

@akien-mga
Copy link
Member

In that case it's probably better as two separate methods as it's doing more than just setting a shared member variable indeed. The descriptions can't easily be unified into what happens when just reading a potential navigation_map or writing to it.

Add NavigationAgent set_navigation_map() and get_navigation_map() function.
@smix8 smix8 force-pushed the navigation_navagent_map_change_4.x branch from 331c1d5 to f10ff0e Compare June 14, 2022 19:48
@akien-mga akien-mga merged commit d2a90d6 into godotengine:master Jun 14, 2022
@akien-mga
Copy link
Member

Thanks!

@smix8 smix8 deleted the navigation_navagent_map_change_4.x branch June 14, 2022 20:59
@akien-mga
Copy link
Member

@smix8 Would be good if you can make a backport for this one to 3.5, it seems like there's still some minor difference in the NavigationAgent code between 3.x and master and I wouldn't want to mess it up (notably in set_agent_parent).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NavigationAgent2D stops working after being placed into new map
4 participants