Attaching Player's in a Networked Game Replication/Prediction Issues.

Sorry, this is a duplicate of a thread I made elsewhere, but I haven’t found an adequate solution to my problem. Not sure if it’s a bug or if I am just not understanding how to accomplish something.

Original thread here : Attaching a player to a player causes jittering in networked game. - C++ - Epic Developer Community Forums

[]
Hi all,

This is pretty much a duplicate of my question here : https://answers.unrealengine.com/que...rs-socket.html

Anyway, I’m trying to carry a player character with another player character. I was hoping it would be as simple as attaching the player to the parent player and disabling movement on the attached player, but I’m having a lot of networking issues. On the client I am getting huge amounts of jitter on the parent player, though the locally owned/attached player moves smoothly as expected. I have tried turning off pretty much everything from disabling movement, turning off physics and collision on everything, disabling tick on the movement component, removing the movement component, and unpossessing the actor, but it still seems to have an unacceptable amount of jitter.

Placing a non-possessed character blueprint in the level seems to work as expected when attached. The player can move around smoothly, and everything seems fine.

My kind of last ditch effort is going to be hiding the player controlled character and spawning a new non-possessed player in the same state, but I’d like to avoid that if possible, because it seems like I should be able to just turn off all the things that are causing the jittering.

Does anybody have any idea what might be causing this?
[/]

And an update from the Answerhub question:

[]
So I’ve tried something new that also doesn’t work. I’m unpossessing the attached player and making him a spectator stuck to the now attached pawn. It is still having huge replication/prediction issues. I was able to add some debug data to show that it’s the attached pawn that appears to be stuttering, not the parent.

I’ve tried doing a similar test with a non-possessed version of my character pawn, and it works as expected on both the client and the server (stays attached to the socket rather than jumping around).

I feel like there must be something I’m missing. What else would be different between a formerly possessed pawn and a pawn that’s never been possessed, and is there a way to make my formerly possessed pawn revert back to that state?
[/]

Even being pointed in the right direction would be great.

Hi mrooney,

Is this still occurring for you or have you been able to find a solution to this question?

Hiya,
I have not found a good solution to this problem. I have found a solution that “works”, but it is ugly. What I ended up doing is making a function that essentially calls SetActorLocation/SetActorRotation to an owning actor’s carry joint, and then calling that function in a ton of places. I call it from the carried player’s tick, from the carrying player’s tick, and from the carrying player’s “PostNetReceiveLocationAndRotation”. Then I also set it to be at that position during some animations.

It’s not a great solution, but it’s the only solution I could get that didn’t look terrible.

[=mrooney;331323]
Hiya,
I have not found a good solution to this problem. I have found a solution that “works”, but it is ugly. What I ended up doing is making a function that essentially calls SetActorLocation/SetActorRotation to an owning actor’s carry joint, and then calling that function in a ton of places. I call it from the carried player’s tick, from the carrying player’s tick, and from the carrying player’s “PostNetReceiveLocationAndRotation”. Then I also set it to be at that position during some animations.

It’s not a great solution, but it’s the only solution I could get that didn’t look terrible.
[/]

Can you show me a screenshot of your blueprint setup? I might be able to see what is going on.

I do it all in Code unfortunately :confused: I don’t know that you’ll be able to access all the locations that I update things in blueprint :frowning:

Sadly I also can’t share the code as I don’t have any seniority at my job at all. I wish I could be more help :frowning:

I can try to give you a better summary than the previous one though.

So my carrying player has a joint/socket in his skeleton. I just have the name of that joint accessible through a constant in my code. In my overridden versions of the functions I mentioned before.

The function I made to move the actor to that joint essentially does this.

  1. Get the offset from the root bone of the carried actor, which is essentially -1.0f * GetMesh()->GetRelativeTransform().GetLocation();
  2. Get the rotation of the target transform of the carrying bone.
  3. Rotate the offset value from #1.
  4. Apply the offset to the target rotation.
  5. Move the actor to the target position and target rotation.