Download

Trace from crosshair on server

Hi all!
In my game I trace for actors that can be interacted with from the players crosshair. Up until now, I have sent the result of this trace to the server, which again checks if this actor is close enough etc, to the player trying to interact.
This is an OK solution, but to really be certain that it works as intended (clients shouldn’t be able to use items on the other side of a wall, even if it is close enough, etc.), I want to move this trace to the server.

Since it is not possible to use GetPlayerViewPoint on the server, how would I go about doing this? Trace from the socket (head) I use for the camera?
In that case, how would I get the proper rotation for the trace? The game is FPP, so all but Z axis on the pawn is locked, so I can’t get it from pawn…

EDIT: Seems like sending rotation from client (not much room for cheating there, with freelook and all), and get position from camera slot, is good enough…