basePartUtil
An utility module for working with base parts.
Functions
corners
Returns a read-only dictionary of all corners of basePart
, top and bottom.
floorMaterial
basePartUtil.
floorMaterial
(
) →
Enum.Material
Returns the material the basePart is lying on. If basePart
is underwater, then Enum.Material.Water
will be returned, elseif
basePart
is in air, then Enum.Material.Air
will be returned.
-
The 2nd argument can be passed as a RaycastParams object, which will be used in determining the material of
basePart
through ray casting. -
The 3rd argument can be passed as a number (depth) which will increase the length of the ray by
depth
studs (on the Y-axis). This is only useful when you want to add in more leeway in determining the material ofbasePart
reliably, since sometimes the basePart may be very slightly over the top of some ground due to its geometry so in those cases, the ray may not register properly. If this argument isn't specified, then it will default to0.01
.