I am currently to to instantiate a box when the player drops it (using "PhotonNetwork.Instantiate"). Now this box, when the player drops it is given data about that box, in the form of an Enum and then distributes the value to the box. But, when the other client picks it up, the box has no values.
code:
[RPC] void dropItem(Item item){
Vector3 playerPos = this.transform.position;
Vector3 playerDirection = this.transform.forward;
Quaternion playerRotation = this.transform.rotation;
float spawnDistance = 1;
Vector3 spawnPos = playerPos + playerDirection*spawnDistance;
string itemname = item.itemName;
GameObject itemAsGameObject = (GameObject)PhotonNetwork.Instantiate("DroppedItem", spawnPos, playerRotation, 0);
itemAsGameObject.GetComponent<DroppedItem> ().item = item;
}
As you can see the client that drops the box has the values. but they arent being passed over to the other clients on the network. how can i fix this?