How would I go about making an enemy AI in Godot 4.0?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Gamer53

I watched some tutorials but

When i try and use the get_next_location()
And set_target_location(target_location) I get errors.

:bust_in_silhouette: Reply From: Ninfur

You need to provide some more details if you want a proper answer. But I’m going to assume you are trying to setup a navigation agent for path finding.

The functions you are trying to call does not exist in Godot 4.0. You can check this by hitting F1 in the editor and try to search for the function name. If you open the documentation for the navigation agent (F1 → “NavigationAgent3D”) (or 2D), you can see that there are some changes from 3.x.

get_next_location() seems to have been renamed get_next_path_position(), and set_target_location() seems to have changed into a field called target_position