Skip to content
Discussion options

You must be logged in to vote

Simpel!

function GetRandomPointInCircle(center, radius)
    local angle = math.random() * 2 * math.pi
    local distance = math.sqrt(math.random()) * radius

    local x = center.x + (math.cos(angle) * distance)
    local y = center.y + (math.sin(angle) * distance)

    local groundZ = 10

    return vector3(x, y, groundZ)
end

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Arootsy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Programming Help Discussions around programming languages, open source and software development
2 participants