Will try help you and tell you the way I did it. Though should mention, mine was made in c++.
First of all, you have to find “aiming point” of each player. You do this only in Player Controller class by finding a point in local Viewport and then deprojecting it from screen to worldspace.
Then, after you got a Vector variable (let’s call it “AimPoint”), it should be replicated to server. And this is the main reason we work with player controller since it’s the only class that is authoritative on client and can replicate variables from Client to Server!
Here you can use RPC, or just set AimPoint to replicate. Can’t really tell which RPC you should use, since I can’t check my PC now, but simple replication should work.
Now on server you got all player controllers each with AimPoint variable containing world coordinate. The tricky part is that you should get those variables from other classes, for example your character class. For this make a call from character to controller that is controling given character and make sure to make that call only on authoritative actor (HasAuthirity node), meaning you get “AimPoint” on server. And then multicast it from server character to all clients with custom multicast event (but be sure to exclude owning client to prevent lag induced jitter). Now you should have individual aiming points for each character.
To summ up:
-
Collect point AimVector data in Player Controller
-
Set AimVector variable to replicate
-
From character make call to controller, get AimVector and put it through multicast event, excluding owning client.
If you struggle with this, I’d be glad to lit it up for you with more examples, but after 23d of december. Cheers!