Arrays in OnSyncedUpdate

Hi when i try to use my own arrays in a 'for loop' in your OnSyncedUpdate void i get null errors.

I have set the length of the arrays in the start but still get errors

It works fine with the same 'for loop' and array in the OnSyncedInput, just the OnSyncedUpdate that doesn't work.

Any reason why this might be?



  • Can you show the code? I don't see why it shouldn't work.
  • Just did a bit of further testing and seem to get null errors on the basics too, I've wrote the code below:

    public override void OnSyncedUpdate () {

    FP X = TrueSyncInput.GetFP (0);
    FP Y = TrueSyncInput.GetFP (1);
    FP Z = TrueSyncInput.GetFP (2);

    I took my array out to test the very basic stuff and i get a null error that repeats every frame on the first line 'FP X = TrueSyncInput.GetFP (0);'

    When i first start my scene i get a warning saying the below

    'You are not connected to Photon. TrueSync will start in offline mode.....'

    Could this have something to do with it?

    Thanks for all the help erickpassos.
  • Hello @Riskki,

    Can you share all the script or sample project in Unity? You can email it to "[email protected]". Thanks.