Hello!
I have built a gravity gun using replicated variables but I’m currently getting quite heavy delays due to the Add Impulse function being called from the server only.
I am not sure how to approach this problem. The result I am trying to achieve is:
- Local client applies an impulse to local only
- The server returns the actual results of the impulse and interpolation does its thing.
Apply it locally for the Autonomous Proxy.
Server applies to Authoritative Proxy… then → Multicast
Multicast checks the local role. If “Simulated Proxy” → apply.
If you are using Character Movement Component (CMC) the server will correct the Autonomous as needed. As long as the Impulse values are “roughly” the same, there shouldn’t be a problem.
You could extend this functionality by setting a “Ping Threshold” which controls how the impulse will be applied.
Say the ping threshold is 50ms. If ping (player state variable) is <= threshold use full server authoritative impulse. ELSE → Client-sim approach noted above.
Low ping players shouldn’t notice the delay from a server auth impulse. This also depends on when you make the call (rpc).