Clean TP Character jerking with Network

Im using the official 4.7.3 release Version, with windows 8.1.

If i enable network, my TP character is jerking around the z-rotation axis.
It has something to do with the network replication.
I think the server wants to adjust the character rotation and that causes the character jerking. (not the camera is jerking, its the character)

And it happens with a clean project:

  1. create a thirdperson c++ project with 4.7

  2. open the character blueprint and enable “use Controller Rotation Yaw”

  3. under Play, enable “Run dedicated Server”

  4. Use A and D to strafe and you will see your character jerking

How to fix it?

My thread: How to disable rotation of socket ? - C++ - Unreal Engine Forums

In your character c++ constructor, make sure you turn off OrientRotationToMovement:

GetCharacterMovement()->bOrientRotationToMovement = false;

Thanks for the answer :slight_smile: Thats the solution.

whats the difference with:

GetCharacterMovement()->bOrientRotationToMovement = false;

and

bUseControllerRotationYaw = true;

Isnt this redundant?

I thought it would be the same, but my character was jerking just like yours, until we changed the other flag too :slight_smile:

good to hear that :slight_smile:

My understanding:

GetCharacterMovement()->bOrientRotationToMovement = false;

This sets if the character should automatically rotates towards the movement direction.

 bUseControllerRotationYaw = true;

If this is true, the camera/controller sets the character rotation.

Am i right?

But, it will be the best that if bUseControllerRotationYaw is true, that bOrientRotationToMovement will become false. I dont know in what situation we want to have both true. That only causes bugs.

I made this function:

void APADefaultCharacter::SetCameraRotatesCharacter(bool Pitch, bool Yaw, bool Roll)
{
	// If true, the characters rotation is set in camera/controller direction
	bUseControllerRotationPitch = Pitch;
	bUseControllerRotationYaw = Yaw;
	bUseControllerRotationRoll = Roll;

	// If true, the character rotates toward the direction of acceleration, using RotationRate as the rate of rotation change
	// you will want to make sure that other settings are cleared, such as bUseControllerRotationYaw on the Character.
	if (Pitch || Yaw || Roll)
	{
		GetCharacterMovement()->bOrientRotationToMovement = false;
	}
	else
	{
		GetCharacterMovement()->bOrientRotationToMovement = true;
	}
}

That looks like a very neat solution! Thanks!

this worked for me in blueprints as well, thanks!