Download

What is the proper way to network move a character to a position in a certain time?

Hey everyone. Possibly a simple question - I still feel pretty rookie to networking so bear with me.

So I have a “dash” in my game, when you press spacebar your char moves 200 cm to the left/right/up/down (diablolike top down view)
I want this to happen in exactly 0.55 seconds (because thats how long the animation takes)

I implemented it currently with a timeline that goes from 0->200 in 0.55 seconds.

Every tick in the timeline I calculate my new position and then setactorlocation on my character. This all happens on the server at the moment. (run on server event)
Works fine on the server, but on the client this is jittery. I take it this is because it takes a few frames for “set actor location” to network to clients, so it jumps every few frames.

How are you supposed to properly implement this? Feel like I’m missing something

Thanks very much in advance!

Here’s the relevant piece of BP. If you need to know anything else let me know:

c053b34d06e17d213893a7f3ce6fb0ce67973383.jpeg

(PS: the rotating back to 0 rotation and adding the movement might also be a wonky way of doing things, I dont really know. Feel free to also tell me how/if I should do it differently)

I would create an animation for that and just use animation blueprint.

You mean with root motion? thats what I first did, but it doesn’t work out for my project for other reasons. Is there a way to do it in BP properly, or do I really need to make it work with root motion?

A lot of time has passed and I’m looking to hop back onto my project but this question still remains, anyone who can share their knowledge? :slight_smile: Thanks