|
I get this error in WebPlayer mode: Assets/My Scripts/HighScoreController.js(19,62): BCE0023: No appropriate version of 'UnityEngine.WWW.EscapeURL' for the argument list '(Object)' was found. Here is my HighScoreController script: pragma strictprivate var secretKey = "lolverysecretkey"; // Edit this value and make sure it's the same as the one stored on the server private var addScoreUrl : String = "http://www.bi.........addscore.php?"; //be sure to add a ? to your url private var highscoreUrl : String ="http://www.bi.........display.php?"; public var hs_post : WWW; public var hs_get : WWW; function Start() { } function postScore(name, score) { } // Get the scores from the MySQL DB to display in a GUIText. function getScores() { // gameObject.guiText.text = "Loading Scores"; gameObject.GetComponent(TextMesh).text = "Loading Scores"; } static function Md5Sum(strToEncrypt: String) { } After debugging a bit I found that when I remove the method call; WWW.EscapeURL(name) on line containing: var highscore_url = addScoreUrl + "name=" + WWW.EscapeURL(name) + "&score=" + score + "&hash=" + hash; The error then dissapears... however it then would not convert the name field to a URL friendly one making the code broken. can anyone suggest a fix? I am not good enough to figure one out yet! thanks guys!
(comments are locked)
|

Have a look at this: http://answers.unity3d.com/questions/45183/adding-extra-information-to-server-side-highscores.html and is name in WWW.EscapeURL(name) a string variable?? It doesn't seem to be declared anywhere..
name is a variable passed in by the constructor. It is a string yes.
Have you tried replacing name with a string and checking if the error still occurs, because in the error it sounds kinda like the name variable is of type Object? Maybe I'm totally off, but it'd be worth testing ;)