I should clarify the length of the ray is 1000.
So from (50, 10,0) to (1050, 10, 0).
What seems to happen is that the containing object’s position is given as the result
i.e.
position = vmath.vector3(50, 0, 0)
And when the from moves past 50, i.e. to 51, even though it is within the enclosing collision object, the ray doesn’t bounce back.
This thread seems to indicate similar issues:
I am trying to determine whether there is enough open space to perform an action, so as a workaround I can have the object determining this wait until it has moved completely past the obstruction before checking again.