Download

Get the viewing angle of another player in multiplayer

Hi, how would I get the viewing angle (pitch) of another player in a multiplayer game ?

Things like get actor rotation doesn’t work - as the actor doesn’t change pitch when the player looks up and down.

I have tried get “Actors View Point”, but for some reason that only works on clients (not the server).

I have also tried get rotation of the camera component, but that seems to only work on the server (not the client).

Any ideas ?

Opponents on your screen in multiplayer are “Simulated Proxies”. They don’t have cameras. You’ll need to look at mouse Pitch and Yaw (always centered on proxy screen). If you are using Aim offset you should be able to pull those values.

What’s your intent?
Simulated proxies are not 100% accurate. Both clients pings, connection quality, server tick (frequency), client and server update rates have an effect (margin of error) on the real world location and rotation of a pawn at any given point in time. There’s also other factors such as Game Thread → Render Thread delays, client hardware delays (processing time, client FPS/refresh rate).

RevOverDrive

Yes this is to drive an aim offset. What I have in place atm, is I capture the mouse pitch / yaws on the client, pass them to the server, and then set a replicated variable. That gets the value to all connected clients who can use the value to set the aim offset.

Seams a bit clunky but it works, is there a more elegant solution ?