So I was using the IAP button as the tutorial showed me and the button won’t work ingame only giving me this error:
NullReferenceException: Object reference not set to an instance of an object
UnityEngine.Purchasing.UIFakeStore.InstantiateDialog () (at Library/PackageCache/com.unity.purchasing@3.0.1/Runtime/Stores/FakeStore/UIFakeStore.cs:175)
UnityEngine.Purchasing.UIFakeStore.StartUI (System.String queryText, System.String okayButtonText, System.String cancelButtonText, System.Collections.Generic.List1[T] options, System.Action
2[T1,T2] callback) (at Library/PackageCache/com.unity.purchasing@3.0.1/Runtime/Stores/FakeStore/UIFakeStore.cs:153)
UnityEngine.Purchasing.UIFakeStore.StartUI[T] (System.Object model, UnityEngine.Purchasing.FakeStore+DialogType dialogType, System.Action2[T1,T2] callback) (at Library/PackageCache/com.unity.purchasing@3.0.1/Runtime/Stores/FakeStore/UIFakeStore.cs:128) UnityEngine.Purchasing.FakeStore.FakePurchase (UnityEngine.Purchasing.ProductDefinition product, System.String developerPayload) (at Library/PackageCache/com.unity.purchasing@3.0.1/Runtime/Stores/FakeStore/FakeStore.cs:163) UnityEngine.Purchasing.FakeStore.Purchase (System.String productJSON, System.String developerPayload) (at Library/PackageCache/com.unity.purchasing@3.0.1/Runtime/Stores/FakeStore/FakeStore.cs:132) UnityEngine.Purchasing.JSONStore.Purchase (UnityEngine.Purchasing.ProductDefinition product, System.String developerPayload) (at Library/PackageCache/com.unity.purchasing@3.0.1/Runtime/Stores/BaseStore/JSONStore.cs:354) UnityEngine.Purchasing.PurchasingManager.InitiatePurchase (UnityEngine.Purchasing.Product product, System.String developerPayload) (at Library/PackageCache/com.unity.purchasing@3.0.1/Runtime/Purchasing/PurchasingManager.cs:60) UnityEngine.Purchasing.PurchasingManager.InitiatePurchase (System.String purchasableId, System.String developerPayload) (at Library/PackageCache/com.unity.purchasing@3.0.1/Runtime/Purchasing/PurchasingManager.cs:69) UnityEngine.Purchasing.PurchasingManager.InitiatePurchase (System.String productId) (at Library/PackageCache/com.unity.purchasing@3.0.1/Runtime/Purchasing/PurchasingManager.cs:43) UnityEngine.Purchasing.CodelessIAPStoreListener.InitiatePurchase (System.String productID) (at Library/PackageCache/com.unity.purchasing@3.0.1/Runtime/Codeless/CodelessIAPStoreListener.cs:145) UnityEngine.Purchasing.IAPButton.PurchaseProduct () (at Library/PackageCache/com.unity.purchasing@3.0.1/Runtime/Codeless/IAPButton.cs:108) UnityEngine.Events.InvokableCall.Invoke () (at :0) UnityEngine.Events.UnityEvent.Invoke () (at :0) UnityEngine.UI.Button.Press () (at C:/Program Files/Games/2020.1.5f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Button.cs:68) UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) (at C:/Program Files/Games/2020.1.5f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Button.cs:110) UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at C:/Program Files/Games/2020.1.5f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/ExecuteEvents.cs:50) UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction
1[T1] functor) (at C:/Program Files/Games/2020.1.5f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/ExecuteEvents.cs:261)
UnityEngine.EventSystems.EventSystem:Update() (at C:/Program Files/Games/2020.1.5f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/EventSystem.cs:376)
I know the generic problem with NullReferenceException but I just don’t understand this.