Help figuring out wandering AI

Godot Version

4.2.2

Question

So, I’m working on a top-down stealth horror game in Godot that requires an AI character to have a Wandering state. The idea is that the AI will roam around the map at random, searching for the player until the player enters their (Raycast2D) vision.

I understand the concept of a Finite State Machine, but the thing is, it’s impossible to find any clear tutorial on how to create what I want to create, if it’s even possible. Am I required to use waypoints on the map? If not, is there anywhere I could go to learn?

Do you want to make the AI randomly patrol?

I want to make it so that while the AI is in their patrol state they wander around the map without necessarily a set point to go to, instead of using waypoints.

You can create this with timer like 5 secs later AI will rotates to a random rotation and go straight, also you can create timer for idle…