Hello, I converted the chat script tutorial Marco Polo (Photon). UnityScript From C # to JAVA. For starters, the line
#C : photonView.RPC("SendChatMessage", target, chatInput);
must be remplaced by
JAVA : PhotonNetwork.photonView.RPC("SendChatMessage", target, chatInput);
Why ?
Then, I get this error with the following code:
“NullReferenceException: Object reference not set to an instance of an object
Boo.Lang.Runtime.RuntimeServices.GetDispatcher (System.Object target, System.String cacheKeyName, System.Type[ ]”
function OnGUI(){
if (GUILayout.Button("ALL", GUILayout.Height(17)))
SendChat(PhotonTargets.All);
}
function SendChat(target:PhotonTargets) {
PhotonNetwork.photonView.RPC("SendChatMessage", target, chatInput);
chatInput = "";
}
@RPC
function SendChatMessage(text:String,info:PhotonMessageInfo) {
AddMessage("[" + info.sender + "] " + text);
}
static function AddMessage(text:String) {
SP.messages.Add(text);
if (SP.messages.Count > 15) SP.messages.RemoveAt(0);
}
Thank you.
…Sorry for the name, error handling