#Server Authoritative Transforms jitter on Client
28 messages · Page 1 of 1 (latest)
silly question, you have the navmesh agent disabled on the client, right?
No, not yet, is that a probable cause?
I just destroy them on the client since they aren't needed
I'll test that quickly
still jittering, the navMesh isn't it then
those are my settings for NT, but yeah IDK, I havent had any issue with jitter with NavMeshAgents
thanks I'll keep trying
Gave +1 Rep to @vagrant dagger
Bump, my objects are still vibrating 😦
bump
you need to add the prediction object
I'll try that 🙂 Other than that I am not using prediction
How do you move them?
public void StartNavMovement(Vector3 targetPosition)
{
//start moving via navMeshAgent
shouldMove = true;
SetNavMeshStopped(shouldMove);
navMeshAgent.updateRotation = shouldMove;
navMeshAgent.updatePosition = shouldMove;
if (navMeshAgent.SetDestination(targetPosition))
{
navMeshAgent.destination = targetPosition;
}
else
{
navMeshAgent.SamplePathPosition(navMeshAgent.areaMask, 5f, out var hit);
navMeshAgent.destination = hit.position;
}
}
and this is a server rpc and you just sync back rotation and pos to clients?
I have a server authoritative NetTransform and I determine the position and run the logic above all on server
And I make sure not to run on the client:
public void Tick(float d)
{
//Only do AI Behaviour if is Server
if (IsClient || !CharacterManager.enabled
|| !stateMachine.currentState || !stateMachine.currentMoodState) return;
}
public override void Init()
{
[...]
if (!IsServer)
navMeshAgent.enabled = false;
}
.
Jitter is on Client only right? would have to do some tests if StartNavMovment is a ServerRPC all seems fine on the first look
There are no RPCs involved. It all runs server sided and I expect the NetTransform to sync back to Observers
@shrewd kiln if you are trying to thank someone please @mention them when saying thanks. Please make a new thanks message while mentioning your helper instead of editing your previous.