mixpanel / mixpanel-unity

Official Unity Tracking Library for Mixpanel Analytics
https://mixpanel.com
Apache License 2.0
45 stars 38 forks source link

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

Open AldeRoberge opened 9 months ago

AldeRoberge commented 9 months ago

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 commented 8 months ago

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