Leaderboard Float Stat not working

Hi,
So, I’ve been trying to get a leaderboard working, which uploads to Steam’s leaderboards, and I can’t seem to upload Float values. It still creates the leaderboard on Steam, and Integer values work fine, but uploading Floats doesn’t add an entry into the leaderboard.

if (OnlineSub) {
	IOnlineLeaderboardsPtr Leaderboards = OnlineSub->GetLeaderboardsInterface();
	if (Leaderboards.IsValid() && uniqueNetIdPtr.IsValid()) {
		WriteObject.LeaderboardNames.Add(leaderboardName);
		WriteObject.SortMethod = ELeaderboardSort::Descending;
		WriteObject.DisplayFormat = ELeaderboardFormat::Seconds;
		WriteObject.UpdateMethod = ELeaderboardUpdateMethod::Force;
		WriteObject.SetFloatStat(leaderboardName, score);
		WriteObject.RatedStat = leaderboardName;
		if (Leaderboards->WriteLeaderboards(sessionName, *uniqueNetIdPtr.Get(), WriteObject)) {
			Leaderboards->FlushLeaderboards(sessionName);
		}
	}
}

Specifically, SetIntStat uploads an leaderboard and an entry with this code just fine, but SetFloatStat only creates a leaderboard. I’ve even tried setting the Stat on Steam to both Float and Int, and it still doesn’t work.
If anyone could help me with this, I’d appreciate it very much.

Okay, so now everything stopped working. I didn’t even change anything, but now the Leaderboard won’t get created and even achievements don’t work. I tested with Blueprints, and that also doesn’t work.

For some reason, the Flush Leaderboards and Cache Achievements nodes don’t trigger either the On Success or On Failure nodes (I haven’t tested yet, but I’m sure the same is true on the C++ side), except if I call the node on the Init of my Game Instance, but even in that case it fails.

Any ideas on what the problem could be? Cause it worked fine a few days ago.

I… I have no words. I’ve spend the last month on and off trying to get leaderboards and achievements to work again, and I finally got it to work by… not reading from the leaderboards on the game’s start? I guess either reading or flushing the leaderboard messes up with the whole system, presumably when done at the game start.

I still haven’t tested anything more than creating leaderboards and unlocking/removing achievements, so I’ll try, tomorrow, to see if I can update the leaderboard, as well as my original problem of updating float stats. I also need to test if reading and/or flushing leaderboards after the game starts also messes the system up, if it’s just at the game start, or if my code was the culprit.

So, after testing, I have confirmed that everything works fine now, including reading from the leaderboard. Here’s what the problem most likely was:

It seems like reading and flushing a leaderboard locks in that leaderboard for the session, so, if the leaderboard doesn’t or no longer exists on Steam when a read or flush occurs, the nonexistent leaderboard is still what’s being attempted to be accessed. This is opposed to writing (and then flushing) to the leaderboard, where a leaderboard doesn’t need to exist to be written to (it creates it if it doesn’t). However, if a leaderboard is written to and then flushed, but then the leaderboard is deleted (such as manually on Steam), then writing to the leaderboard will once again no longer work because the flush locked in that deleted leaderboard as the one to use.

This doesn’t, however, prevent another leaderboard from being read from or written to, or the same leaderboard so long as it wasn’t deleted, but, once it is read or flushed, the same will then apply to it too.

Now, I don’t know the specificity on how this all functions, so take this explanation as a non technical one: this all seems to function like this, but I don’t exactly how it “locks in” the leaderboard or if there is a way to change it, or if I’m missing how this works by a margin.

Though, from what I’ve gathered, assuming I’m correct on how this works, the following should be adhered to: if the player can read from a leaderboard before they can write to it, then make sure it is already created on Steam; If it will be written to before being read from, then it should be fine because it will be created on Steam before being read from. I hope this helps anyone with a similar problem.

Now, my original problem still exists: it doesn’t seem possible to upload a float value to the leaderboard. So, does anyone know if this is simply impossible to do or is there a way to do so?