I'm trying to make it so it can calculate a position from all 4 top corners and the middle of the top 4 sides of a part.
Every time I run this function it keeps printing out (0, 0, 0) even though the Part isn't positioned at the origin.
local vector3 = Vector3.new
local random = Random.new()
local function returnRandomPos(objectPos, objectSize)
local posLibrary = {
vector3(objectPos + vector3(-objectSize.X, 1.5, -objectSize.Z)),
vector3(objectPos + vector3(objectSize.X, 1.5, objectSize.Z)),
}
local index = random:NextInteger(1, #posLibrary)
return posLibrary[index]
end
local object = workspace.Part
local randomPos = returnRandomPos(object.Position, object.Size)
print(randomPos)

2 comments
It was because you were putting a vector3 inside a vector3 and trying to add them together. I think.
Yeah I figured that out. Thanks though.