Alright, so i thought i understood RPC functions. But I guess not. I need help. So in the thirdperson template I wanted to test out a sprinting function. I binded in my project editor and everything a sprint then made a start/stop sprint function with a bool bSprint to check. So theres that. Mind you, I replicated my bSprint variable. So then i made a serversprint with the proper uproperties. Then i made a regular sprint that just handled regular sprinting logic so i can call it in the serversprint_implementation. Heres what it looks like.
So then i tried with a “ClientSprint” because maybe it was client calls, server checks, then goes back to client. Still didnt work. Also tried with netmulticast, still nothing. Please, what am I misunderstanding here?
For proper sprinting (to work with the Character Movement Component) you really want to handle it via the Character Movement Component. Issue is, when you sprint, you are adjusting the “Walk Speed”. This can lead to situations where the server doesnt quite get updated in time, the client sends in its location different to what the server thinks it should be, and ends up being corrected. This will cause “rubber banding”. More noticable on higher pings (>150). But for your crude implementation, you are kinda doing it weird.
@TheKaosSpectrum So I tried using this and it seems that when i press shift nothing happens. Im using the playerinputcomponent to bind my left shift to sprint. I tried creating a startsprint stopsprint, because you cant bind functions that have parameters. But ill be playing around with it maybe i can get the concept down and get it working. I think im pretty much headed in the right direction but if you get back to me before then, even better
I haven’t gotten back to doing this on my project yet. Too many other unknowns I been working on. I seem to remember Tom’s project he shared, https://www.tomlooman.com/survival-sample-game-for-ue4/ , has sprint working. Maybe that will help you.
Hi, its too late, but i have my own variant how to replicated sprint.
h:
cpp:
Im not sure about this variant, I’m just starting to learn multiplayer programming