So bassicaly i want get the highest point of a part, you guys will probaly say “just divide the y axis by 2” it just work if the part isnt rotated, if you rotate that wont work anymore, i find a code that shows the lowest point
local function getDir(v)
return (
((v.Y == 0) and Vector3.new()) or -- flat
((v.Y > 0) and -v) or -- flip
v -- perfect
)
end
local function computeLowestPoint(part)
local cf = part.CFrame
local dist = part.Size/2
local xVec = getDir(cf.RightVector) * dist.X
local yVec = getDir(cf.UpVector) * dist.Y
local zVec = getDir(cf.LookVector) * dist.Z
return (cf + xVec + yVec + zVec).p
end
iam bad with math so i dont know how find the highest instead.