Hello everyone,
I want to know how to get a random point within a part’s radius. I have searched everywhere but none worked for me or I couldn’t implement them correctly.
here is what I have currently:
local Radius = 30
local HouseFloorBoundries = Vector3.new(-188.443, 1.165, 23.736)
local Part = Instance.new("Part",workspace)
Part.Transparency = 1
Part.CanCollide = false
Part.Anchored = true
repeat
print("Repeating")
local X = math.random(0,Radius)
local Z = math.random(0,Radius)
Part.Position = HouseFloorBoundries + Vector3.new(X,1.5,Z)
local Distance = (Part.Position - PrimaryPart.Position).Magnitude
task.wait(0.000001)
until Distance >= 15
however the code above only seems to get a point in one corner of the part and ignore the other 3
is there something wrong with the code? Thanks for your time