Download

Client-Side Hit Detection

I am making a multiplayer co-op shooter… went down the path of client-side hit detection thinking that it would feel more responsive and accurate.
(players cannot shoot each other - only ai enemies)

But it doesn’t seem like it is really possible to do client-side hit detection, given:

If the RPC is being called from Client to be executed on the Server,
the Client must own the Actor that the RPC is being called on.

Since the server owns the target actors in this case, it must be the one to trigger damage. e.g. A client-side simulated proxy cannot call a server function, so a Client-owned hero could cause server damage to a server-owned actor.

Now I am switching to server-side and all is good ( clearly the more common approach )

But I am just wondering -
Is it even possible to do Client-Side Hit Detection in UE? (without rewriting my own RPC stuff )

In case someone stumbles upon this, I did find an answer.

to reiterate, the issue was around how to apply damage (which is server only) from a client-side zombie (which is non-owner simulated proxy). (the line trace originated on hero)
the solution was to pass a reference to the zombie to a server function on the hero (which is owned by client connection)
server side hero can damage server-side zombie
so you can pass a reference to an actor as a parameter to a server RPC, as long as you are owner of object making server rpc call

see Cedrics awesome compendium:
http://cedric.bnslv.de/Downloads/UE4_Network_Compendium_by_Cedric_eXi_Neukirchen.pdf

page 67