Choose Random Point Inside A Part

I know that math.random(-xsize/2,xsize/2),math.random(-ysize/2,ysize/2),math.random(-zsize/2,zsize/2) works but, thats only if the part is 0,0,0 rotation, when i rotate the part, the random points makes it that the part is still acting like the 0,0,0 rotation, idk if u get what i mean but basically when i rotate the big part that items are suppose to spawn randomly inside it, the items still spawn randomly like the big part is not rotated

Your question is not precisely clear or well-formatted (check pinned post on #help-and-feedback:scripting-support). I suggest you provide extra details such as screenshots, videos, and/or code when making posts as these may help us help you.


To calculate a random point relative to the size, position, and rotation, create a Vector3 with random decimal numbers using half its size. Multiply the randomized Vector3 to the Part’s CFrame, e.g local Random_Point = Part.CFrame * Vector3.new(random values based on part size here).

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.