Ray shape for 2D collisions. Ray shape for 2D collisions. A ray is not really a collision body, instead it tries to separate itself from whatever is touching its far endpoint. It's often useful for characters. Return the length of the ray. Set the length of the ray. The ray's length.