I have updated my AC to V.176.0 and Unity to 2021 and now as soon as my SteamManager script is called in the first scene, the game crashes, on MAC only, PC and Linux are both fine...
Below is my applied Custom Action:
using UnityEngine;
using System;
using Steamworks;
#if UNITY_EDITOR
using UnityEditor;
#endif
/* By Alvaro Urrutia Luna (Alverik)
* Custom action to
* Unlock Steam achievements.
*/
namespace AC
{
[System.Serializable]
public class ActionUnlockAchievement : Action
{
// Declare variables here
public string AchievementID = "";
public ActionUnlockAchievement()
{
this.isDisplayed = true;
category = ActionCategory.Custom;
title = "Unlock Steam Achievement.";
description = "Unlocks an steam Achievement.";
}
override public float Run ()
{
//your action:
if (SteamManager.Initialized)
{
if(AchievementID!=String.Empty || AchievementID!="")
{
try
{
SteamUserStats.SetAchievement(AchievementID);
SteamUserStats.StoreStats();
}
catch(Exception e)
{
Debug.LogError("Error while setting steam achievements... " + e);
}
}
}
//end the action
return 0f;
}
#if UNITY_EDITOR
override public void ShowGUI ()
{
// Action-specific Inspector GUI code here
AchievementID = EditorGUILayout.TextField("Achievement ID: ", AchievementID , GUILayout.ExpandWidth(true));
AfterRunningOption ();
}
public override string SetLabel ()
{
// Return a string used to describe the specific action's job.
string labelAdd = "Unlocks an steam Achievement.";
return labelAdd;
}
#endif
}
}
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
And here is the SteamManager script:
Any idea why this now might be the case?
Thanks!
Are you using the correct Steamworks.NET for your Unity version?
The Action doesn't refer to the SteamManager script, but SteamUserStats. Neither are AC scripts, however, so the issue likely isn't coming from AC itself.
As an aside, this Action uses the old Action format. Here it is using the new format: