RayCast or LineCast?

Hi,

First let me say I’ve chosen LineCast because I’d read that Linecast will detect intersection even if both StartPos and EndPos are within the collider in a old post in this forum.

I’m generating a flight path and every 0.2 seconds I call a routine that sends out line casts in a 180 degree arc looking for colliders, all works fine until one of the line cast arcs spawns say inside a block, like a tower block, even with the ends of the line cast showing through the block they do not show a detection, has line cast been changed, now on Unity 5.5

Cheers.

just tested this, and linecast behaves like raycast, ie. the direction matters so it won’t register a collider hit if the start position is inside of the collider. If both start and end positions are inside it also doesn’t register a hit. I don’t know if this was recently changed, but it’s way it is now!

I’m working on a project that needs to do a similar thing to yours with ray/linecasts and what I’m doing is using two RaycastAll in BOTH directions to get an array of colliders no matter where the cast starts/ends.