Hello everybody.
I’m making an object identification system outside a specified area through three-dimensional Vectors, I’ve been having problems identifying objects outside the area in which they have a rotation in which they make the object misaligned and thus occupy a space outside the area specified by the vector.
Below is a code example in which I am mentioning.
local Area = {
Position = Vector3.new(50, 0, 80), -- Ignore the Y axis.
Size = Vector3.new(100, 0, 100) -- Ignore the Y axis.
}
local Object = Instance.new('Part', workspace)
Object.Size = Vector3.new(10, 0, 10)
Object.Position = Vector3.new(5, 0, 0)
Object.Orientation = Vector3.new(0, 45, 0)
local XAxisEdge = Object.Position.X + Object.Size.X/2
print(XAxisEdge)
--[[ The XAxisEdge variable does not handle the orientation, which means that it will not be possible to check if it is outside the area correctly. ]]
Thank you very much in advance!