How do i get a navagent3d to pick a random point on the navmesh

Godot Version

4.2

Question

How do i get my nav agent 3d to pick arabdon spot on the map, i think its a 4.3 feature but idk, also i cant get 4.3 bcs of my dads bad pc
(from what i remember my dads pc cant run opengl 3.3)

Also sorry for no code my script is prob 50% only that

Thanks in advance

I’m still working on basics but it’s working and can be tested.

Sorry for the late reply, does it check if its a “valid spot” like in the nav mesh or does it go over the nave mesh (sorry if the reply is late)

@onready var nav_region: NavigationRegion3D = $NavigationRegion3D

var random_point_3d: Vector3 = NavigationServer3D.region_get_random_point(nav_region.get_rid(), 1, false)

If you can just use a navigation region.