The raycast that i made, that goes around in circles and spawns parts doesnt work, the circle isnt centered and its making me mad. The code to position the ray is right here:
(NOTE: The “pos” variable is just HumanoidRootPart.Position)
local rx = pos.X + rnd:NextNumber(-1,1)
local rz = pos.Z + rnd:NextNumber(-1, 1)
local lookAt = Vector3.new(rx, pos.Y, rz)
local orientation = Vector3.new(rnd:NextNumber(-60, 60), rnd:NextNumber(-60, 60), rnd:NextNumber(-60, 60))
local lv = CFrame.new(pos, lookAt).LookVector
local position = pos + (lv * radius * math.clamp(h/numCircles, 0.5, 1))
local cf = CFrame.new(position, pos + lv + orientation)
local floorRay = workspace:Raycast(cf.Position + Vector3.new(0, 3, 0), position - Vector3.new(0, 100, 0), rp)
what im doing is just positioning the rock to floorRay.Position, and this is what i get: