Linecast with no obstacles in between, returns colision on Vector3.Zero


we have just migrated to version 4.2.18 and we have found a strange behaviour in the LineCast function.

Linecast Error

As you can see in the gif, when there is no obstacle between the two points, the collision returned is in Vector3.Zero. Although the documentation specifies that in case there is no obstacle, the value of “point” will be the value of the destination point.

We have solved this by changing this GridGenerator code


for this one


Is this solution correct?
Is there any reason for this value to be returned like this?



That’s very true. It was inconsistently handled. I’ll include a fix for this (and a few other inconsistencies I found) in the next beta update.