Get a random position around a object?

  1. What do you want to achieve? Keep it simple and clear!
    I want to know how I could get a random position around a part.

  2. What is the issue? Include screenshots / videos if possible!
    I have no idea how I’m supposed to do that

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I have tried to get a random Cframe around the object by multiplying it with a random Cframe but that didn’t work…

So, how would I do this? I have no idea how to handle this problem and would like all the help I could get. Thanks!

1 Like

Can you explain more how you want it to be distributed?
In a circle?
In a square?
Something else?

A square grid around the player

local randomOffsetX = math.random(1,10)
local randomOffsetY = math.random(1,10)
local randomOffsetX = math.random(1,10)

randomPosition = object.Position + Vector3.new(randomOffsetX ,randomOffsetY,randomOffsetZ)
3 Likes

what if we want to get a random position around the player in circle?

2 Likes