Ray 2D shape resource for physics. Ray 2D shape resource for physics. 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.