Hello,
I'm having problems passing a Vector3 through photon. Essentially we are sending a Vector3, followed by a Float through OnSerliezeView. On the receive end we are getting a Vector4 and thus having a casting issue because we are expecting a Vector3.
We have since moved the Float to before the Vector3 send as denoted below and it seems like it is working fine now.
I'm having problems passing a Vector3 through photon. Essentially we are sending a Vector3, followed by a Float through OnSerliezeView. On the receive end we are getting a Vector4 and thus having a casting issue because we are expecting a Vector3.
We have since moved the Float to before the Vector3 send as denoted below and it seems like it is working fine now.
if (stream.isWriting)
{
stream.SendNext(colliders.localRotation.eulerAngles.y);
stream.SendNext(carRigidbody.position);
stream.SendNext(carRigidbody.velocity);
stream.SendNext(new Vector3(carRigidbody.rotation.eulerAngles.x, carRigidbody.rotation.eulerAngles.y, carRigidbody.rotation.eulerAngles.z));
}
else
{
PacketInfo packet;
packet.mTime = info.timestamp;
packet.mDriftAngle = (float)stream.ReceiveNext();
packet.mPosition = (Vector3)stream.ReceiveNext();
packet.mVelocity= (Vector3)stream.ReceiveNext();
Vector3 EulerAngles = (Vector3)stream.ReceiveNext();
packet.mRotation = Quaternion.EulerAngles(EulerAngles);