Created
August 20, 2018 14:08
-
-
Save IJEMIN/f2510a85b1aaf3517da1af7a6f9f1ed3 to your computer and use it in GitHub Desktop.
Get Random Position on NavMesh in Unity
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you don't mind having the "random" points in a grid, you can pregenerate points according to the navmesh's bounds and generate points using Mathf.PerlinNoise
Afterwards you can exclude all points that aren't found by NavMesh.SamplePosition and then choose a random valid point with Random.Range(0, pointList.Count)