Hello again,
Maybe I'm just stupid, but I don't know why I'm getting error while calling GameManager method or just while trying to get value of variable.
Code:Code:TypeError Object has no method 'GetPlayerCount':
Cheers!Code:var global = importNamespace("");var UnityEngine = importNamespace("UnityEngine");var plugin = { Init: function() { command.AddChatCommand('test', this.Plugin, 'commandTest'); }, commandTest: function(session, cmd, arg) { this.chat(global.GameManager.GameName, false, session); } };
Solved Calling GameManager methods in JS
Discussion in 'Hurtworld Development' started by SilentHillft, Feb 4, 2016.
-
global.GameManager.Instance.GameName
-
Well, I was trying it out earlier, but still nothing.
Code:TypeError Instance is undefined
-
[DOUBLEPOST=1454593182][/DOUBLEPOST]Last edited by a moderator: Feb 4, 2016 -
Nope, getInstance and GetInstance is not method of this object.
-
-
Fixed.
For others:
Code:global.Singleton(global.GameManager).Instance.GameName