Hello, I’m trying to get the position of the end of the part event when its rotated.
lets inspect how this might work:
As you can see, normally I would do +Size/2 to get the end of a part. However, look at how this equation would work on a rotated part:
As you can see on a rotated part, this position would not be the correct one. So how do I ensure that the position I am getting is correct, even when the part is rotated, so it would look like this?
so lets say I wanted to check if a rotated part was beyond the position 10 studs on the X axis. I could do:
local cf = part.CFrame * CFrame.new(part.Size.X/2, 0, 0)
local posX = cf.Position.X
if posX > 10 then
print("Rotated part past 10 studs")
else
print("Rotated part within bounds")
end