Search Unity

OnSerializeNetworkView lead in NaN,NaN,NaN error??

Discussion in 'Multiplayer' started by DubStepMaster, Apr 3, 2013.

  1. DubStepMaster

    DubStepMaster

    Joined:
    Jul 17, 2012
    Posts:
    40
    Hey there

    Input position is { NaN, NaN, NaN }

    this is the script for these error:

    Code (csharp):
    1. void OnSerializeNetworkView(BitStream stream, NetworkMessageInfo info){
    2.         if(stream.isWriting)
    3.           {
    4.            stream.Serialize(ref CurrentPosition);
    5.            stream.Serialize(ref CurrentRotation);
    6.           }
    7.           else
    8.           {
    9.            stream.Serialize(ref CurrentPosition);
    10.            stream.Serialize(ref CurrentRotation);
    11.           }    
    12.     }
    this doesn't work too

    Code (csharp):
    1. void OnSerializeNetworkView(BitStream stream, NetworkMessageInfo info){
    2.         if(stream.isWriting)
    3.         {
    4.         stream.Serialize(ref CurrentPosition);
    5.         stream.Serialize(ref CurrentRotation);
    6.         }
    7.         else
    8.         {
    9.         stream.Serialize(ref CurrentPosition);
    10.         stream.Serialize(ref CurrentRotation);
    11.         OutsideView.transform.position = CurrentPosition;  
    12.         OutsideView.transform.rotation = CurrentRotation;
    13.         }      
    14.     }
    currentPosition is {NaN,NaN,NaN} but currentRotation works fine.

    anybody can help me??

    thanks
     
    Last edited: Apr 3, 2013
  2. landon912

    landon912

    Joined:
    Nov 8, 2011
    Posts:
    1,579