Misprediction and Server Reconciliation Example

Hi, just trying out the example for Misprediction and Server Reconciliation, but having errors with the code example from here Server-authoritative setup | Unity Multiplayer SDK Documentation | coherence. Do you know what I might be doing wrong?


Also does this example cover rotation reconciliation or just position? If not how would you add that?

Many thanks coherence team :+1:

Hey!

What you’re missing is the import of System.Linq. Please add this somewhere next to existing usings:

using System.Linq;

The FirstOrDefault is an extension method that’s defined in the Linq namespace. We forgot to mention this in the example. I’ll make sure this gets fixed.

Also does this example cover rotation reconciliation or just position? If not how would you add that?

I believe the approach would be identical to position - you’ll want to find the “rotation” binding (make sure it is bound via CoherenceSync configuration first) and subscribe to its sample receive event. Then in the callback you can calculate the difference in angle between predicted and received values and make a correction if needed.

Great thank you very much. :+1:

Ok that has cleared, that error. but now I have a new one:

Assets\Coherence_prediction.cs(13,3): error CS0123: No overload for ‘DetectMisprediction’ matches delegate ‘Action<object, bool, long>’

any thoughts?