Support threads, fixes, and FAQs.

Error! Unable to connect to the remote server

Last activity: 4/17/2024, 12:09:23 PMJoin the discussion →
Original post
Hello. I received the API key and manually entered it into Unity. However, as soon as it is connected, the message "Error! Unable to connect to the remote server" appears. How do I solve this problem?? ps. I checked the same issue post, manually entered the API key, and downloaded the Newtonsoft package again, but it didn't work 😭
Community Member11/19/2023, 7:36:41 AM
Community Member11/19/2023, 1:45:05 PM
<@174193097285173250> can you help out here when you got some time? :)
Community Member11/19/2023, 10:30:01 PM
ive tested the plugin and it still works fine for my environment. As the other threads mentioned already, this error message is caused, when the websocket token given to the script is not valid. the most common reason for that is, that when copy pasting the token into the script, they copy to much or to few of the token. for example leading spaces. the token itself should be a string made out of 64 characters. make sure it has that length for you as well.
Community Member11/20/2023, 1:16:48 AM
I wrote it manually several times, but the error is the same.. I wrote it in VSCODE, is this the problem?
Community Member11/20/2023, 5:46:57 AM
The editor used to add the key is not relevant.
Community Member11/20/2023, 5:51:20 AM
Also, you can add the token by editing the websocket token attribute of the script directly in the scene editor of unity. Maybe you edited it there? This would make changes in the script file not work because unity prioritizes scene editor values
Community Member11/20/2023, 3:23:58 PM
I can't solve the problem.. 😭 Does unity editor have to be a professional version? Or should the UNI.T editor version be 2020.3.27f1??
Community Member11/20/2023, 3:28:49 PM
It works for all unity Editors as far as I know. It doesn't have to be professional licence, as it works for me on my personal (free) licence
Community Member11/20/2023, 3:32:44 PM
Can you try to add the following line to the "hyperateSocket.cs" file at the circled location `Debug.Log(websocketToken);` Then compare the log output with the token you got. It should be the same.
Community Member11/20/2023, 3:39:42 PM
I tried adding log, but no value is output.
Community Member11/20/2023, 3:55:23 PM
Weird... where did you add the token? Is it in the cs file, or in the canvas->text object where the script is linked? And is the websocket token attribute in the text object of the scene written in bold letters? That would indicate that it overrides the value in the cs file
Community Member11/20/2023, 3:57:59 PM
(My current guess is, that you edited the cs file, but also removed the token attribute value in the scene object, basically overriding the value from the cs file with a blank string)
Community Member11/20/2023, 4:06:21 PM
😱😱😱 I set the name of the websocketToken variable differently, but the error was resolved!!!!!!!! As you said, the variable seems to have been reset in other files as well. Thank you so much 😊
Community Member11/20/2023, 4:06:41 PM
Community Member4/15/2024, 4:14:56 PM
I have gone through all of these, i have tried only setting the websocket token in the unity component editor of the text object, i have tried setting it both there and in the script variable as well, i have tried writting it in by hand. The unity editor websocket token attribute is not in bold text, if that matters. When i do the debug log as requested above it shows my 64 digit key as it should. (see picture)
Community Member4/15/2024, 4:16:45 PM
i tried changing the name of the websocketToken variable as well, did not change anything
Community Member4/15/2024, 4:25:02 PM
is something wrong with my key, since i canot use it to connect?
Community Member4/15/2024, 5:45:41 PM
Can you send me your token via private message pls? So I can take a look in our backend
Community Member4/15/2024, 6:24:15 PM
after doing "something" on the server side and then making sure to use the legacy text object type, all errors where solved ^^
Community Member4/17/2024, 11:47:28 AM
<@204187417136070656> can you share what exactly did you do? I am facing the same problem after having tried all the aforementioned tips
Community Member4/17/2024, 11:49:39 AM
I was not the one to fix it, the hyperate team was, specifically Yannick. He did "something" with my api key on the backend and after that i could connect.
Community Member4/17/2024, 11:50:15 AM
ok, thank you! <@120250275477979136> could you possibly help me as well?
Community Member4/17/2024, 11:51:22 AM
Can you send me your API token via PN pls? :)
Community Member4/17/2024, 11:58:08 AM
Okay API token seems to be working - so it must be something in Unity. Did you use the "legacy text object" type?
Community Member4/17/2024, 12:03:36 PM
i just made sure that I used the legacy text object type and now everything is working, thank you!
Community Member4/17/2024, 12:09:23 PM
https://tenor.com/view/welcome-gif-23701526
Cookie preferences