Get a random point within a distance||doc135587

September 20, 2022

Format

 AIControl:randPosNearBy(maxDis)
  • The class to which the function belongs:AIControl

Description

Get a random point within the maxDis range of the AI entity


Parameters

Parameters type Description
naxDis float maximum distance


Value Returned

type Description
vector v3 Location

Code Samples

on the entity object servermount script, get a random point within the maxDis range of the AI entity

local control = this:getAIControl()
local randomPos = control:randPosNearBy(5) -- Gets random points within the scope of AI entity 5