Looking at the documentation for BoxCast, it seems there are multiple ways to interpret the first two parameters origin
and size
. Notably, we could have
+------ size.x -------+
[origin] ------------------+ +
| | |
| | size.y (1)
| | |
+---------------------+ +
+------ size.x -------+
+---------------------+ +
| | |
| | size.y (2)
| | |
[origin]-------------------+ +
+- size.x -+
+---------------------+ +
| | |size.y
| [origin] | + (3)
| |
+---------------------+
So which one is it? For what it’s worth, having the pivot of a 2D sprite character at its feet (so at the center bottom) seems to not align with the parameters of this function.
EDIT: it turns out this is the correct picture:
+------- size.x ------+
+---------------------+ +
| | |
| [origin] | size.y (4)
| | |
+---------------------+ +