mixpanel-unity icon indicating copy to clipboard operation
mixpanel-unity copied to clipboard

"UnityEngine.Assertions.AssertionException: Assertion failure. Value was False"

Open AldeRoberge opened this issue 1 year ago • 1 comments

AssertionException: Assertion failure. Value was False Expected: True — UnityEngine.Assertions.AssertionException: Assertion failure. Value was False Expected: True void UnityEngine.Assertions.Assert.Fail(string message, string userMessage) void UnityEngine.Assertions.Assert.IsTrue(bool condition, string message) x 2 void mixpanel.Value.Merge(Value other) in ./Library/PackageCache/com.mixpanel.unity@f64bde1541/Mixpanel/Value.cs:223 void mixpanel.Controller.DoTrack(string eventName, Value properties) in ./Library/PackageCache/com.mixpanel.unity@f64bde1541/Mixpanel/Controller.cs:346 void mixpanel.Mixpanel.Track(string eventName, Value properties) in ./Library/PackageCache/com.mixpanel.unity@f64bde1541/Mixpanel/MixpanelAPI.cs:275 void Magic.Modules.Analytics.MagicAnalytics.PlayerScoreIncreaseEvent(int score) in Assets/Magic/Modules/Networking/Client/Runtime/Scripts/Analytics/MagicAnalytics.cs:21

This happens when running the following code :

public static void PlayerScoreIncreaseEvent(int score) => Mixpanel.Track(nameof(PlayerScoreIncreaseEvent), score);

Would it be possible to have a better error message? I can't seem to understand why this happens, and I couldn't find in the todcs

Assert.IsTrue(_valueType == ValueTypes.ARRAY || _valueType == ValueTypes.OBJECT);

AldeRoberge avatar Feb 04 '24 06:02 AldeRoberge

Still getting this error, it seems like the API wrapper doesn't handle numeric values... We must use the MixPanel.People.Increment and MixPanel.People.Decrement to pass float values

AldeRoberge avatar Feb 17 '24 02:02 AldeRoberge