Launch character in multiplayer

I’m trying to make my character jump with launch character.

This is in multiplayer.

Why is it not working?

Can someone help? I’m really confused as to why this is happening.

I really need this solved. bumped

Can any one help me with this?

I have the same problem! Please help if you know how to fix.

Same problem for me!

I know I am a few years late on this one, but I want to answer this so anyone like me stumbling across this post can get help. In multiplayer, the server automatically replicates character movement to the clients, however, it does not replicate launch character. The launch character will only be replicated or even function properly if it is called on the host/server. To fix this, you must make your launch character an event which is set to run on server. You can then call the event from your character to make it jump. I hope this helps anyone who may still have this problem.

repeat the exact same code using a custom event node and then click on the red custom event and tick an option that says replicates or whatever
then youd run this custom event node
to ensure that no bugs happen on your scree copy and paste the code after youve triggered the custom event

Hey Rymazon,

I have it setup such that is is being called by my server, but it doesn’t work.

I am creating a dash feature like in titanfall, where pressing a button makes the mech dash forward and I am doing this by using the LaunchCharacter node.

The mechanic works fine on the server ofc, but when I try executing it from the client the mech only moves forward only a small amount. Ive cross checked the output from the timeline against the output on the server and they are similar, just the amount the mech moves forward is different

Hey Fahood,

I did exactly that in the above code strip, I have an event that is calling the dash on the server which then multicasts the actually code with the launch node. Still the results are the same.

Is there something wrong with my setup?

I believe for it to properly be replicated the launch character note needs to be executed on the server instead of on all clients. What I believe is happening now is that it launches the character on all clients but since it didn’t launch the character on the server, the server replicated the original position back to the clients. If you launch the character on the server, it will replicate the launched position to all the clients. I have not tested this but based on my understanding of replication, this, in theory, should work.

Hey Rymazon, thanks for your reply. So I did try out putting the launch character node on the server only and removed the multicast, but still it behaves exactly the same.

I also tried executing the launch node on the client only and it in fact behaved in the same way as well. I think the character movement replicates movement natively and so the launch is being replicated regardless of where it’s executed, but for some reason it just isn’t behaving as intended on the client

I removed the timeline and just directly called launch character and it behaved as expected, on both client and server, and moved my mech forward a bit. So the launch character node does indeed work regardless if it’s ran on client or server and it replicates fine as well.

The reason it only moves a little bit is because the vector I input is small I think. Once I increased it it moved more.

So then my issue is why is my timeline not fully outputting on the client? It seems like only the first update frame is being calculated, which is why it only moves a small amount

Edit: nvm this actually didn’t work, the search continues :frowning:

I figured it out!

For anyone who runs into a similar issue to mines, the fix for me was to add a gate in front of the timeline. Once the code gets past the gate I immediately closed it and then once the timeline finishes I open up the gate again.

I think what might be happening is that across the network the signal to run the timeline might be happening on every frame which causes it to repeat constantly without finishing, it’s analogous to having a timeline that is set to play on tick. And so, by gating it off I can allow the timeline to finish without interruption, and then open it back up once it has finished so I can run it again.

I was wondering do short timelines cause replication issues on the network?

Because my timeline is 0.25s long, I was starting to get curious if maybe it’s just too short for the network to replicates its values across.

When I converted it to 2s it seemed to do better, though not quite fully accurate when compared to the server side behavior

Yeah sorry, I’m not quite sure what to do then. The last thing that I would try is making it fire on both the server and the clients at the same time, but considering that the other things didn’t work, I don’t know if this would.

This is true, but if you call launch character on server and there is high latency, there will be lag when player presses the input and after a character will actually be launched. This is generic problem of course. Solution is related to network prediction which means, that client (autonomous proxy) basically moves the character and server corrects its movement. In this case, client launches the character, but server rolls that back, as it doesn’t happen on server, so server sees it as not a valid movement (maybe even a hack from client). Movement replication / prediction works in UE4 out of the box for simple movement, but not for stuff like “launch character”. To make replicated / predictive launch character work means you have to send Launch velocity to server as part of move data, this is not trivial, but was already done in Smooth Networked Movement in Code Plugins - UE Marketplace which is free plugin. You can investigate the plugins source code to see how it’s done.

I may be a bit late, but I recently ran into the same problem trying to do a long jump action via the “Launch Character” node, and I think I found a solution. At least it works for me.

That was my blueprint snippet, where the player would get launched if they pressed the space bar. It worked perfectly for the listen server, but not for the clients.

So I thought why not calculate the movement on the server. I mean sure, it would take some time, especially with high latency and ping, but it’s the best I could come up with.
So I just added a custom event called “Long Jump”, clicked on it and changed the “Replicates” setting in the details tab to “Run on Server”.