You're using the Raycast() method incorrectly. Raycast() takes either an origin point and a direction vector, or a ray, which is essentially the same thing. However, you're passing it an origin point and a destination point. If you were passing those same parameters to Linecast(), you'd be golden. But if you want to use Raycast() instead, you'd need to pass it a direction vector instead of a destination point.
↧