Is this supposed to be normal?
I just made a simple test and it seems OnSerializeNetworkView is not sending a bool value when a button is pressed. I've checked all variables and everything is ok because I switched back to RPC and it sends the bool value just fine.
Could someone please check this with me?
using UnityEngine;
using System.Collections;
public class Character_Network_Script : MonoBehaviour
{
public bool this_is_client = false;
public bool test;
public bool received_test;
public bool test_result;
void OnNetworkInstantiate(NetworkMessageInfo info)
{
if (networkView.isMine)
{
this_is_client = true;
}
}
void Update ()
{
test = false;
received_test = false;
test_result = false;
if (this_is_client)
{
if (Input.GetKey (KeyCode.Alpha5))
{
test = true;
}
}
}
void OnSerializeNetworkView(BitStream stream, NetworkMessageInfo info)
{
if (stream.isWriting)
{
stream.Serialize(ref test);
}
else
{
stream.Serialize(ref received_test);
test_result = received_test;
}
}
}