# 4.21 vehicle rotate jitter in network

**URL:** <https://forums.unrealengine.com/t/4-21-vehicle-rotate-jitter-in-network/451526>\
**Category:** Multiplayer & Networking\
**Tags:** Networking, dedicated-server, UE4-21, vehicle-advanced-tem, unreal-engine, bug-report, question\
**Created:** [July 1, 2019, 6:02am UTC](https://forums.unrealengine.com/t/4-21-vehicle-rotate-jitter-in-network/451526 "2019-07-01T06:02:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![TYS\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TYS\_1](https://forums.unrealengine.com/u/TYS_1)\
**Post date:** [July 1, 2019, 6:02am UTC](https://forums.unrealengine.com/t/4-21-vehicle-rotate-jitter-in-network/451526/1 "2019-07-01T06:02:27Z")

</div>

I use vehicle project in ue4.21

when run the project by check run dedicate server,

go forward or back is well,but when rotate the car, it well be jitter terribly

---

<div class="post-metadata">

**Author:** ![Shelby](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shelby](https://forums.unrealengine.com/u/Shelby)\
**Post date:** [July 27, 2019, 4:54pm UTC](https://forums.unrealengine.com/t/4-21-vehicle-rotate-jitter-in-network/451526/2 "2019-07-27T16:54:18Z")

</div>

I have the same issue…

---

<div class="post-metadata">

**Author:** ![TYS\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TYS\_1](https://forums.unrealengine.com/u/TYS_1)\
**Post date:** [September 19, 2019, 2:10am UTC](https://forums.unrealengine.com/t/4-21-vehicle-rotate-jitter-in-network/451526/3 "2019-09-19T02:10:30Z")

</div>

> **[The Unreal Engine Issues and Bug Tracker](https://issues.unrealengine.com/issue/UE-69232)**
>
> Welcome to the Unreal Engine Issue and Bug Tracker. You can check the status of an issue and search for existing bugs. See latest bug fixes too.

i have a temp solution,  
custom class physicReplication, override function OnTick and SetReplicatedTarget

ChariotPhysiscReplication.h

```
#include "CoreMinimal.h"
#include "PhysicsPublic.h"
#include "PhysicsReplication.h"
#include "PhysicsInterfaceUtils.h"

/**
 * 
 */
class CHARIOTGAME_API FChariotPhysiscReplication : public FPhysicsReplication
{
public:
	FChariotPhysiscReplication(FPhysScene* PhysScene);
	
protected:
	virtual void OnTick(float DeltaSeconds, TMap<TWeakObjectPtr<UPrimitiveComponent>, FReplicatedPhysicsTarget>& ComponentsToTargets);
	
	virtual void SetReplicatedTarget(UPrimitiveComponent* Component, FName BoneName, const FRigidBodyState& ReplicatedTarget);
	
	bool bUpdatePos;
};

class CHARIOTGAME_API FChariotPhysicsReplicationFactory : public IPhysicsReplicationFactory
{
public:
	FChariotPhysicsReplicationFactory();

	virtual FPhysicsReplication* Create(FPhysScene* OwningPhysScene) override;
	virtual void Destroy(FPhysicsReplication* PhysicsReplication) override;
};

```

ChariotPhysiscReplication.cpp

```
// Fill out your copyright notice in the Description page of Project Settings.

#include "ChariotPhysiscReplication.h"

#include "PhysicsEngine/PhysicsSettings.h"

FChariotPhysiscReplication::FChariotPhysiscReplication(FPhysScene* PhysScene)
	: FPhysicsReplication(PhysScene)
{
}

void FChariotPhysiscReplication::OnTick(float DeltaSeconds, TMap<TWeakObjectPtr<UPrimitiveComponent>, FReplicatedPhysicsTarget>& ComponentsToTargets)
{
	if (bUpdatePos)
	{
		bUpdatePos = false;
		FPhysicsReplication::OnTick(DeltaSeconds, ComponentsToTargets);
	}
	

}

void FChariotPhysiscReplication::SetReplicatedTarget(UPrimitiveComponent * Component, FName BoneName, const FRigidBodyState & UpdatedState)
{
	FPhysicsReplication::SetReplicatedTarget(Component, BoneName, UpdatedState);
	bUpdatePos = true;
	
}

FChariotPhysicsReplicationFactory::FChariotPhysicsReplicationFactory()
{
}

FPhysicsReplication* FChariotPhysicsReplicationFactory::Create(FPhysScene* OwningPhysScene)
{
	return new FChariotPhysiscReplication(OwningPhysScene);
}

void FChariotPhysicsReplicationFactory::Destroy(FPhysicsReplication* PhysicsReplication)
{
	delete PhysicsReplication;
}

```

use physic in gameinstance,cpp yourself

```
void UChariotGameInstance::Init()
{
	Super::Init();
	
	FPhysScene::PhysicsReplicationFactory = MakeShareable(new FChariotPhysicsReplicationFactory());
}

```

Config DefaultEngine.ini

```
[/Script/Engine.PhysicsSettings]
PhysicErrorCorrection=(PingExtrapolation=0.100000,PingLimit=100.000000,ErrorPerLinearDifference=1.000000,ErrorPerAngularDifference=1.000000,MaxRestoredStateError=1.000000,MaxLinearHardSnapDistance=400.000000,PositionLerp=0.050000,AngleLerp=0.10000,LinearVelocityCoefficient=0.200000,AngularVelocityCoefficient=0.628319,ErrorAccumulationSeconds=1.000000,ErrorAccumulationDistanceSq=3.000000,ErrorAccumulationSimilarity=100.000000)

```

this is useful for me!

---

<div class="post-metadata">

**Author:** ![BMacZero](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BMacZero](https://forums.unrealengine.com/u/BMacZero)\
**Post date:** [September 7, 2021, 6:50am UTC](https://forums.unrealengine.com/t/4-21-vehicle-rotate-jitter-in-network/451526/4 "2021-09-07T06:50:05Z")

</div>

I had the same issue with an AWheeledVehicle actor smoothly replicating linear motion but snapping its rotation, especially at lower speeds. I solved the issue by increasing the Rotation Quantization Level on the actor’s Replicated Movement from Byte Components to Short Components. I’ve only tested this fix in PIE with simulated latency.
