I’ve been sitting here for a while trying to get all the edges of a part but due to a bad explanation I got lost immediately. Can anyone help out with this with a decent explanation, I’m not the best when it comes to math on the platform.
1 Like
Assuming you have a standard rectangular part, you can get all edges by multiplying positively or negatively half of the part’s size to its CFrame.
Your parts CFrame is the center of it, so if you multiply that by .5 * Part.Size.X, you’ll return the CFrame of one of the part’s faces. If you also multiply by .5 * Part.Size.Y, you’ll get the top edge of that face. If you go one more step and multiply by .5 * Part.Size.Z, you’ll get a vertice.
Make any of these negative and you’ll return the opposite side.
Face = Part.CFrame * CFrame.new(Part.Size.X/2, 0, 0)
Edge = Part.CFrame * CFrame.new(Part.Size.X/2, Part.Size.Y/2, 0)
Vertice = Part.CFrame * CFrame.new(Part.Size.X/2, Part.Size.Y/2, Part.Size.Z/2)
3 Likes