Varriable wont reassign

Hi all,

So my method OnAudioReceivedMax(); doesn’t seem to reassign the variable value on line 70. When I print out AudioLengthSeconds in line 506 it gives me the right value which is received from Max/MSP but when I print AudioLengthSeconds in the FixedUpdate(), it still gives me the old value of 6. Does anyone know how to fix this?

 70 [SerializeField] private float AudioLengthSeconds = 6;

 311 void FixedUpdate()  
 312  {
 313   if (Vector3.Distance(MarkB.transform.position, Seeker.transform.position) >= 0.0100001)
 314    {
 315          Seeker.transform.localPosition += new Vector3((140 * Time.fixedDeltaTime) * 1f / 
              AudioLengthSeconds, 0, 0)
 316    }
 317  }

503  public void OnAudioReceivedMax(float AudioLengthFromMax) 
504  {
505     AudioLengthSeconds += AudioLengthFromMax / 1000; //  convert from milisec to sec
506     print(AudioLengthSeconds);
507  }

change your line 70 to

[SerializeField] private float AudioLengthSeconds  dont assign .

As you have make this field serialize for assign this value in inspecter not in the code. some times assigning value through code creates issue i dont know why.