Line 17 of my code is returning an error
#pragma strict import ExitGames.Client.Photon.Chat; //public class ChatGUIScript extends MonoBehaviour//, IChatClientListener (I don't know how to write this in unityScript, but I get the feeling it's necessary) var chatAppId : String; var chatClient : ChatClient; var userName : String; function Start () { DontDestroyOnLoad(this.gameObject); Application.runInBackground = true; chatClient = new ChatClient(this);//THIS IS THE PROBLEM LINE chatClient.Connect(chatAppId, "1.0", userName, null ); } function Update () { print(userName); if (this.chatClient != null) { this.chatClient.Service(); } else print("chatClient equals null");//This gets printed because line 17 isn't working }
This is the error I get: InvalidCastException: Cannot cast from source type to destination type.
ChatGUIScript.Start () (at Assets/Scripts/ChatGUIScript.js:17)
1
Comments
-
Yes, implementing that interface seems to be important, even in Unity Script.
I am sorry but I can't really help in Unity Script.
I would try this:
http://unity3d.com/search?refinement=an ... nityscript0