Jitter with basic transform sync

Hey guys!

I finally just started making some very simple tests with coherence, so far I just have a new project, using a movement plugin for the player character (Easy Character Movement 2, just for simple prototyping), added Sync to the transform position/rotation and animation parameters so that the animation is synced (all just with the CoherenceSync checkboxes), turned rigidbody kinematic on remote, disabled inputs on remotes… just the very very basics, but even when testing with 2 builds connected to a local replication server, I feel a considerable amount of jitter in the movement from remotes… I’ve played a bit with the interpolate settings, I checked the Campfire example (in which I dont see any jitter), copied the optimization settings (increased frequency of update, value ranges etc), and it seems a bit better on my example but still not great.

Please check this message on Discord, in which I attached a video of what I mean:

I would expect that in such as simple example, it should feel super smooth since it is the best case possible, so I am not sure if I am doing something wrong?

Best,
Allan

Hi Allan, welcome to the forums and more in general to our community!

It should definitely be smooth! Your setup seems correct, the only thing I can think of is: besides optimisation settings (aka the “Optimize” button that brings up the specific window), are you also setting the bindings to interpolate, in the Configuration window?

I believe some bindings now are set to not interpolate (None) by default, so you might have to set them to Default Interpolation - or set a custom one.

(I read just now that you say you did try playing with interpolation, I’ll leave it just in case…)

Another guess is, what are you using for “Interpolate on”?

Maybe enabling multiple event functions creates the jitter? I usually use either Update OR FixedUpdate.

And then, another point: how does Easy Character Movement 2 apply movement? Does it write to the Transform’s position, does it use AddForce on the RB, or does it modify its velocity? This might give an insight into what’s happening.

Let us know, and we can figure it out :slight_smile:

Hi Ciro!

Thank you for the help! In my example it is already using Default Interpolation, and these are the CoherenceSync values I am using:

The way this plugin ends up moving the character is like this:

image

It does its own physics calculations along the way since it is more of a physics based character controller.

Let me know if you need any additional information, and if you have any ideas!

1 Like

What I was thinking originally is that, if the controller used AddForce there might have been something lost there because the object which should receive the force is kinematic. But with SetPositionAndRotation there’s no inertia at play.

However, another thought: is the Rigidbody set to interpolate?

I can see that you have configured the CoherenceSync to apply the position to the RB directly (with “Direct”).

This writes directly to the transform’s position and rotation, and it’s something many people want. But try maybe switching it to “Interpolated”, and see how it goes? That would be the equivalent of calling SetPosition and SetRotation on the RB, which is what the character controller does.

Hey Ciro,

I’ve just checked and the Rigidbody is configured to interpolate. I’ve just made anoter test with the latest configs, so that is the optimization settings, all we talked about above, and now also using RigidbodyUpdateMode as Interpolate, and this is the result:

Using local replication server:

Using a Cloud room:

It is definitely better than it was in the first video, but given that this is basically the best possible scenario, I would still expect it to be smoother. Should I remove the interpolate from the Rigidbody/update mode? What would be the ideal config?

Thanks once again for the support!

1 Like

I’m not sure, it’s all a combination of factors, so I can’t say for certain, you might have to turn it off and test. But in my head, it’s ok if it stays. You might have to check if Extrapolate gives better results than Interpolate though!

But anyways, it looks better now though, right? To my eyes it seems like the character is moving in space quite fluidly. There seems to be a slight hitch in the animation when it stops, but maybe that’s not related to movement (?)

Could make sense to try to debug this without animation (or even better, with a simple capsule with arms :smiley: ) so you can clearly see what’s happening.

PS: more info on Interpolate vs. Extrapolate: Unity - Manual: Apply interpolation to a Rigidbody

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.