#Server Authoritative Transforms jitter on Client

28 messages · Page 1 of 1 (latest)

restive hawk
#

Hey you can see the struggle in the video, I wonder whats happening.. Any ideas? It is possible that the NavMesh is causing the client to place the enemy on the ground and the server lifts it back up.

It looks like the server places the objects higher.

vagrant dagger
#

silly question, you have the navmesh agent disabled on the client, right?

restive hawk
vagrant dagger
#

I just destroy them on the client since they aren't needed

restive hawk
#

I'll test that quickly

restive hawk
vagrant dagger
#

those are my settings for NT, but yeah IDK, I havent had any issue with jitter with NavMeshAgents

raw mountainBOT
#

Gave +1 Rep to @vagrant dagger

restive hawk
#

Bump, my objects are still vibrating 😦

restive hawk
#

bump

viral flare
#

you need to add the prediction object

restive hawk
restive hawk
#

They still stutter all the same :/

#

Any ideas guys?

shrewd kiln
#

How do you move them?

restive hawk
# shrewd kiln 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;
            }
        }
shrewd kiln
#

and this is a server rpc and you just sync back rotation and pos to clients?

restive hawk
#

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;
        }
shrewd kiln
#

Jitter is on Client only right? would have to do some tests if StartNavMovment is a ServerRPC all seems fine on the first look

restive hawk
shrewd kiln
#

ah my fault ok got it

#

i will setup a quick test project

umbral violetBOT
#

@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.

shrewd kiln
#

hmm seems to work fine for me in a minimal setup