Good morning,
I’ve installed on premise release of Nakama Server (rel. 3.12).
Unity is 2022.1.5f1 and Unity SDK is 3.4.1.
All seems works fine BUT I had some troubles using match game fuctions and status function.
In the beginning I supposed it’s related to some my errors in the game I’m developing.
At this point I tried to run Fishgame demo: in the past works perfectly but now I didn’t see the other player.
In the Unity Editor, If I inspect the RemotePlayer the X and Y position it’s wrong: really high numbers.
here the results:
To be sure I redownloaded the fish game demo, rebuild and rerun but the result it’s the same.
Do you have suggestions?
@solidsnakeit I see some text sneaked into your comment, I’m sure it was just a mistake but please try to stick to English in the interest of the community :).
The fish game demo was built using Unity 2019.4.19f1 and Nakama 2.12.0, if you use different versions it’s entirely possible you’d run into issues. Please use the respective versions.
I tried using Unity 2019 without success. Maybe the issue depends by latest mala,a server version or by some setting (defaults by now) on my server.
In any case,in my opinion, it will the best if demo and tutorials are updated to latest release of your products.
I will continue to find the cause, when I found it I share with this awesome community,
Have a nice evening
Fixed: the problem is the decimal separator.
The server is in en-US format.
My computer is it-it.
The .ToString () function returns a number with the separator “,”.
When converted to float it is a disaster.
In the “MatchDataJson.cs” code I forced the decimal separator.
Here is an example:
public static string VelocityAndPosition(Vector2 velocity, Vector3 position)
{
CultureInfo ci = new CultureInfo("en-US");
ci.NumberFormat.NumberDecimalSeparator = ".";
var values = new Dictionary<string, string>
{
{ "velocity.x", velocity.x.ToString(ci) },
{ "velocity.y", velocity.y.ToString(ci) },
{ "position.x", position.x.ToString(ci) },
{ "position.y", position.y.ToString(ci) }
};
return values.ToJson();
}