- Home /
I get 2 errors every time iI run my program. Help!
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?)
Answer by pako · Jun 18, 2015 at 07:59 AM
It's just a spelling error: Use ReceiveNext () not RecIEveNext () ('i' after 'e' in 'receive').
Your answer
Follow this Question
Related Questions
Photon Network instantiate problem when Master changes 0 Answers
How to connect to our own dedicated server using photon networking in unity?(Self-hosted) 0 Answers
PhotonNetwork Scripted Spawn player 0 Answers
Custom Properties, Unity, Object refence not set to an instance of an object 0 Answers
Multiple Cars not working 1 Answer