Get random points||doc136833

September 20, 2022

Format

Lib.randPosInRegion(region)
  • Function class:Lib
  • Call limit:Common

Describe

Returns a random coordinate in the region.


Matters Needing Attention

  • The area here is a table with min and Max coordinates
  • Coordinates must be integers

parameter

Variable name Type Describe
region table Table with min, Max coordinates


Return value

Type Describe
Vector3 coordinate


Code example

local region = {min = Lib.v3(0,0,0), max = Lib.v3(2,2,2)}
local pos = Lib.randPosInRegion(region)