Using PlayerPrefs to transfer variables from Javascript to C#

Don’t worry, I am not calling it on update.

Anyways, I have a Javascript code which sets a string in PlayerPrefs.

Then I have a C# script (has to be C# as its a multiplayer section of the game) and I want to call upon the PlayerPrefs for it.

Is it possible? And can I just say: PlayerPrefs.GetString(“username”);

Well, it should be possible. You would have to make sure the C# script is called after the JS code, if it’s in the same frame. To do this, you may be able to specify the script execution order (assuming you can do this between both languages, not sure).

I haven’t tried this, but you could try reading the value directly.
Try following this tutorial to see if it’s possible for your scenario:

Ideally, if both code files are yours (ie. not a purchased asset from the store), convert it all to c#. Conversions are fast and easy, as both languages share a lot of commonality.