How to make enemy to wonder around randomly

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Serenade
:warning: Old Version Published before Godot 3 was released.

Hello!
Can anyone please write here code that would randomise enemy’s random walking (2D tiles set)
When i learned Gamemaker, there was a code that kinda choosed 1 from 4 numbers, and depending on the number it chose, it went diferent way, it also had a stall code that made it look like it walks, then stops to think about reason of life,lol, and then goes somewhere else again.
Thank you! :slight_smile:

:bust_in_silhouette: Reply From: timoschwarzer

randi() % 4 returns a random number between 0 and 3 (inclusive).
The rest of the code depends on how you have set up your scene.