Replicate maxWalkSpeed

I have a character that can do a very fast dash attack.
I change the maxWalkSpeed to x8 for 0.3 seconds and then back again.

Works perfect in PIE but I’ve noticed some jittery movements sometimes when I play on my remote server. Same thing when I simulate NetPackageLag=100.

The script for the attack is running on the server, so to change the speed on the client as well, I use a custom event to replicate to the client.

After some experimenting I managed to get rid of the jitter by making sure I change the speed on the client first, and then have a custom event change it on the server. It’s much smoother!

Here’s the problem. For my attacks duration of 300ms the character will be allowed to collide with a target, and deal some damage etc. But the delay before the character starts running fast will potentially get eaten up partially or completely by the lag, and the time period where it can collide will pass before it starts dashing.

There must be some clever best prectice for things like this! Any ideas? :slight_smile:

I actually want the main char to stop on collision. :slight_smile: How do you mean I should use a sweep?

Another aspect here is that I often use the same change-speed-function to slow chars. My current setup (the one that makes things smooth) will give laggy players more time to escape before the slow kicks in, right? :confused:

I had a problem similar to this which i solved by recording the start location and upon reaching the end location, doing a capsule trace from the former to the latter to see what it ran into.
In your case you will probably need a multi capsule trace to get all the stuff he runs into, and probably overlap only, no blocking collision channels.
Also dont doble hit so you have to track which things already got hit by the collision or the trace so the other one doesnt cause it.

I would recommend a sweep to make it simpler but sweeps make the character stop moving upon a blocking hit.

Well on a Set Actor Location you have a sweep option that basically does what my trace idea suggests between the old location and the new, but automatically stops the actor if there’s something between it and the target location, and stops it at the obstacle. However, it does this instantly.

You know what? How about for your dash, you move the character using a Timeline between his start and destination locations? You can replicate the server’s Timeline node to synchronize it across all the clients. This would work well if it is okay for the player to not be able to change directions during the dash.
Also, a Timeline could control the maxwalkspeed rather than the location of the character if you want to preserve steering.

This! I want the attack to take over the control so it would be perfect. This could probably the solution for ideas I have for similar leap attack! Will try this tomorrow and report back!