No announcement yet.

mutiplayergame problem, how to attach a passenger to a car,how to solve jitter on client?

  • Filter
  • Time
  • Show
Clear All
new posts

    mutiplayergame problem, how to attach a passenger to a car,how to solve jitter on client?

    First apologize for my bad English First . . . I try my best to let every body can understand. .
    I have a problem when I am makeing Unreal 4 online games.
    This is a question about passengers getting on and off the car. I have successfully solved the problem of getting on and off the driver,
    but I I want to make a passenger that can be attached to the car and have some actions and shots. . . I created a socket in the co-pilot position of the car,
    and then let the player-controlled passenger go to the server-side to execute the "attachtoactor" method to connect to the socket on the car.
    I used the "disablemovement" method on the server for the passenger. But on the client side, the player-controlled passenger's car has serious jitter,
    the server side is normal, and the other clients are jitter...
    but when the server-side character connects to the socket as a passenger, all the clients are all normal,
    When the client-side character connected to the socket as a passenger, the car on the player's client will be greatly jitter.
    the client which controlled by the player can rotate the passenger's angle of view(the passenger is still controlled by me,and it just attached to a socket on server). If execute "disablereplicatedmovement" on server-side ,
    the Jitter is missing , but the server can't receive the client's actions..
    I feel like there is a contradiction between the client's autonomy and the server's replicating of the passenger as part of the car. . .

    i have tryed lot's of setting but not work at all......

    Or does this method simply not work? Is there any other way? Sincerely thank you for your help.
    Last edited by pengyk12; 10-08-2019, 05:56 AM.

    I know that this is kind of late, but this is what I found works, after months of testing. I like to do this on server, and multicast, that way no one sees them lag, but I'll try and figure out a more optimized way to do it. When when you enter the vehicle, you need to call a run on server event. This even should pass through your player, the actor you want to attach to, and your socket name. Then you want to call that player and get the character movement, set movement mode to none, and the most important part. You need to set Ignore Client Movement Error Checks And Correction to true, and then attach to actor using all the stuff you passed through that event. Just be sure to reverse all of these when exiting the vehicle. Ignore client error movement checks will allow you player to stay where he should without the server correcting him. This is the most critical part of not lagging. I also call a multicast that just disables the collision on the mesh and the capsule. I hope that this helps you, and if it didn't I'm sorry, but hopefully it will help someone else in the future.

    There is a link to a visual pastebin that you can copy.