Line 17 of my code is returning an error

edited June 2015 in Photon Chat
#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 ()
    Application.runInBackground = true;
    chatClient = new ChatClient(this);//THIS IS THE PROBLEM LINE
	chatClient.Connect(chatAppId, "1.0", userName, null );

function Update ()
	if (this.chatClient != null)
    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)


Sign In or Register to comment.