RayCast is different Server vs Client!

Confused - Are you trying to resolve the raycast on the client or the server?

Network communication takes time - so you need to design an approach to account for that.

There are costs and benefits to both approaches.