Raycast and Linecast

Can anyone tell me what’s the different between raycast and linecast?

Linecast will detect intersection even if both StartPos and EndPos are within the collider.
Raycast will not detect intersection if its Origin is within the collider.

Linecast is slower but safer way to detect intersections.
Raycast is faster but not accurate.

Raycast can be used to get information from objects you’re casting the ray at, Linecast returns true if there is a collider between the start and the endpoint of the line.

If i understand the documentation right, then you cant chose exactly where the linerender ends, you just say it should go from “a” to “b”, whereas the raycast casts a ray from a point in a direction of your choosing.

Personally i’d use a linecast for tripwires and the like in games, and a raycast for shooting at stuff.

Hope this helps

Kacer