Blockcast nuances

image

Does the workspace:Blockcast() direction parameter for “direction” with a magnitude of make the blockcast extend the raycast like the first image, or round it up to cast it like the second image?

Or none of the above?

Blockcasting
(Unit: studs)

Here is how blockcasting looks like when the directional length is 2 studs. As you can see, it extends for half of the size of the block over the two studs from its centre.

Attempting a length of 1.999 studs or closer technically shouldn’t detect the part, though such precise numbers are prone to the floating point error.

Note that if the ray starts inside the obstacle, it won’t detect it, in other words, if the grey block was intersecting the blue block. I don’t know how the implementation details look like, so I drew the image assuming the casting starts on the parts surface, because even if it starts in the centre, that makes no difference.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.