How to replicate rotation smoothly,without character using controller rotation Yaw?

My mech character is using tank rotation to move,to do that im using add actor world rotation to rotate the character.

293064-20191127-152253.jpg

The controller Yaw input is not controlling my characters rotation.Character will not rotate when player rotating camera.

The rotate function is running on server ,and multicast set actor rotation to update the client character rotation.
But using set actor rotation makes the rotate of the character really stutter.
Is there a way in blueprint to update the character more smoothly?

If your pawn is actually a character, you should stick to character movement replication instead.

My guess is that you try and multicast replicate the rotation, causing the clients to simulate the rotation, then the default character replication comes in and creates the stutter. What happens when you just leave the multicast out and stick to the server only applying the rotation?

Let me know if you need more help.

Now comes something interesting…In the client now i’m playing ,the characters rotation looks very stutter,almost stuck in the same place.But in the other client`s view ,my character rotates much more smoothly, basically feels like what i want.

When I directly plug the add rotation to the input ,character complete stuck there(rotation).
I think you are right .But how can i do next?

Hi, if your pawn don’t has wheels I would strongly recommend that you use a character instead, because it seems to me that right now you’re taking a pawn and trying to turn it into a character :slight_smile:

If you want to replicate movement of a pawn, then first you can increase the precision of the replicated rotation.

293095-replication-precision.png

And run the movement logic on the client and server to reduce/eliminate lag due to network latency/update frequency. So when the player inputs something the client will react (rotate) immediately without stutter. Then the server runs the same logic and then replicates it over to the client and all other clients. And because they are running the same logic and if you have increased the precision of the replicated rotation, normally you won’t see any difference.

That described setup above is nearly the same as what the “Character Movement” does automatically (the character movement also interpolates between the current state of the client and the replicated state of the server so there you normally won’t need to increase the precision), so you could directly use a character and save the work.

1 Like

My character is already based on third person character.I almost didnt change any thing about Characters Forward&back Movement ,but to simulate the inertia of the character`s rotation, i used timeline for it,and change it to tank movement. I think the way i make it move like tanks cause all of this problems.

293135-20191128-91536.jpg

when i link it like this ,the character rotate twice speed on the server

But the ForwardVector is the same with client.

293132-20191128-93530.jpg

When the rotation only run on server,and no multicast,the client cant rotate at all, although in the servers view it rotated,but can`t actuall walk towards the direction of its rotation.

293133-20191128-94913.jpg

When add in run on own client ,the server is fine ,but the rotation in client is half of the client.

Edit: Sorry just saw “whitout use controller rotation yaw”

If your mech is a “Character” and not only a “Pawn”, the default character movement should handle the replication so you should not multicast it and only apply the rotation serverside.

What does your “Mech Rotation” function actually do? Does it only like “AddActorRotation” or do your mechs maybe rotate based on animation with root motion? If this is root motion based, replicating this would be a bit more complex.

MechRotation is just AddActorRotation with some bool to branch the speed with rotation.The AddActorRotation make the rotation of my character bypass the character movement. So it won’t be replicated and cause it act like this.

Now i knew that the best way to fix this may just write a C++ for my own.But it looked not worth it for me to stuck on this now.Now im working on the graphics part of my game,so thanks for all your help and advise.Maybe after this game become more completely ,i will return back to deal with this problem.Thanks again at last!