I am creating a game, and I’m using a NavigationRegion2D node for the navigation. I am not using a tilemap for the collisions or navigation, so when generating the world I have to bake the navigation polygon to the trees’(which are randomly placed) and other objects’ collision polygons. For this I am using the navigation region’s method: bake_navigation_polygon, but for some reason godot is giving the error: “Function “bake_navigation_polygon()” not found in base self.” Any help? Here’s the code for the navigation region:
extends NavigationRegion2D
signal polygon_ready
func _on_world_tree_ready():
var on_thread : bool = true
bake_navigation_polygon(on_thread)
polygon_ready.emit()
That error is misleading, if you have otherwise errors from e.g. garbled script parsing or failed scene loads in your project the script can not load the extends class and therefore does not find the function from that class. Fix the other errors or reload your project to fix script errors with e.g. class_names and other random stuff that may all be a source for this error.
It seems that the NavigationRegion doesn’t recognize other methods either, I think it’s probably from recently updating from 4.0 to 4.2. Any way to fix it?