Hi i have been doing the tutorial to integrate a leaderboard into my game. so far so good but when i finally get half way through the 5th video i get an error telling me that i cannot convert my score into a long ? as far as i know i didnt set my game to use long values and my gamesparks api is working fine? any ideas
public void PostScores(float myScore)
{
new GameSparks.Api.Requests.LogEventRequest_postScore().Set_Score(myScore).Send((response) =>
{
if (response.HasErrors)
{
Debug.Log("Failed");
}
else
{
Debug.Log("Successful");
}
});
}
Assets/Assets/RFTS/Scripts/Game/ShipController.cs(443,73): error CS1503: Argument `#1' cannot convert `float' expression to type `long'
Best Answer
G
Greg Quinn
said
almost 8 years ago
A long is a signed 64-bit integer. Passing a float to a long won't work as they are two very different data types.
Just change your method to accept an int or a long.
1 Comment
G
Greg Quinn
said
almost 8 years ago
Answer
A long is a signed 64-bit integer. Passing a float to a long won't work as they are two very different data types.
Just change your method to accept an int or a long.
james mcc
Hi i have been doing the tutorial to integrate a leaderboard into my game. so far so good but when i finally get half way through the 5th video i get an error telling me that i cannot convert my score into a long ? as far as i know i didnt set my game to use long values and my gamesparks api is working fine? any ideas
public void PostScores(float myScore)
{
new GameSparks.Api.Requests.LogEventRequest_postScore().Set_Score(myScore).Send((response) =>
{
if (response.HasErrors)
{
Debug.Log("Failed");
}
else
{
Debug.Log("Successful");
}
});
}
Assets/Assets/RFTS/Scripts/Game/ShipController.cs(443,73): error CS1503: Argument `#1' cannot convert `float' expression to type `long'
A long is a signed 64-bit integer. Passing a float to a long won't work as they are two very different data types.
Just change your method to accept an int or a long.
Greg Quinn
A long is a signed 64-bit integer. Passing a float to a long won't work as they are two very different data types.
Just change your method to accept an int or a long.
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2487 topics