- Home /
Stange Error, please help...
Hello! I have a strange problem that occurred. I have a script viewing the players in a scene over the network, It was working fine, fully finished on the tutorial. However... as im working on my menus or multiplayer menu then switching to my main menu (scene) I get this error message when i load the scene... "The type or namespace name MonoBehaviour' does not exist in the namespace
Photon'. Are you missing an assembly reference?"
Here's the script...
using UnityEngine;
using System.Collections;
public class NetworkCharacter : Photon.MonoBehaviour {
Vector3 realPosition = Vector3.zero;
Quaternion realRotation = Quaternion.identity;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if ( photonView.isMine ) {
}
else {
transform.position = Vector3.Lerp(transform.position, realPosition, 0.1f);
transform.rotation = Quaternion.Lerp(transform.rotation, realRotation, 0.1f);
}
}
public void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info){
if (stream.isWriting) {
// This is OUR player. We need to send our actual postion to the network.
stream.SendNext(transform.position);
stream.SendNext(transform.rotation);
}
else {
// This is someone else's player. We need to recive their postion (as of a few milliseconds ago, and update our version of that player.
realPosition = (Vector3)stream.ReceiveNext();
realRotation = (Quaternion)stream.ReceiveNext();
}
}
}
Sounds like something is messed up with your environment. Are you using monodevelop? Are other scrips using Photon.$$anonymous$$onoBehaviour still working? If not then it sounds like you're missing a reference to Photon in your project file.
Your answer
Follow this Question
Related Questions
Switching scenes photon networking 2 Answers
Photon Networking: LocalScale transform doesn't work 1 Answer
Photon player RaiseEvent sending bools 1 Answer
Question regarding unity mobile multiplayer game 0 Answers
Unity Editor Crash !!! 0 Answers