Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can I find the position between more than 2 points ?

I am doing a script that needs a lot to find the central position between 2 positions, but I do not know how I can get the position between 3 or more points. Is that possible and is there any way to do this?

2 comments

0

Hey Rodrigo, could you possibly give some imagery behind this request? Like draw it out in paint and send me a screencap so I can tell you if you need to triangulate it, use magnitude, pythagorean theorem, etc etc. The way you defined this is a bit confusing. Also, it is notable that this will be rather difficult to accomplish without proper math & a few intermediate methods of calculating points.

0

Yeah, I'm also confused of the question.

1 answer

By points you mean Vector3 positions? You can simply average them out like you would with single numbers.

local points = {}

local sumVector = Vector3.new()
for _,v in ipairs(points) do 
	sumVector = sumVector + v
end

local center = sumVector / #points

This discussion is preserved as it was. New answers, comments, and votes are closed.