I get 2 errors every time i try to run my game. Here is the script that is causing problems. I have Unity 5 BTW.
I am using Photon Unity Networking (PUN) which is very similar to Unity Networking.
Here is the code:
using UnityEngine;
using System.Collections;
public class Multiplayer : Photon.MonoBehaviour {
public GameObject myCamera;
// Use this for initialization
void Start () {
if(photonView.isMine){
myCamera.SetActive(true);
GetComponent<Drivetrain>().enabled = true;
GetComponent<CarController>().enabled = true;
GetComponent<Rigidbody>().useGravity = true;
AntiRollBar[] AntiRollBar = GetComponents<AntiRollBar>();
foreach(AntiRollBar bar in AntiRollBar)bar.enabled = false;
}
else{
myCamera.SetActive(false);
GetComponent<Drivetrain>().enabled = false;
GetComponent<CarController>().enabled = false;
GetComponent<Rigidbody>().useGravity = false;
}
}
void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info){
if(stream.isWriting){
stream.SendNext(transform.position);
stream.SendNext(transform.rotation);
}
else{
transform.position = (Vector3)stream.RecieveNext();
transform.rotation = (Quaternion)stream.RecieveNext();
}
}
}
These are the errors that I get:
-
Assets/Photon Unity Networking/Multiplayer.cs(29,70): error CS1061: Type
PhotonStream' does not contain a definition for
RecieveNext’ and no extension methodRecieveNext' of type
PhotonStream’ could be found (are you missing a using directive or an assembly reference?) -
Assets/Photon Unity Networking/Multiplayer.cs(30,73): error CS1061: Type
PhotonStream' does not contain a definition for
RecieveNext’ and no extension methodRecieveNext' of type
PhotonStream’ could be found (are you missing a using directive or an assembly reference?)