Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: Alatriste on December 24, 2018, 11:37:12 AM
-
Hi,
I'm not very familiar with those actions so bear with me.
I have this inventory add-on and I want to open the inventory UI panel through playmaker. I'm not sure how I can call the method to do it, because when I use the "Invoke Method" I'm only getting the following error message:
NullReferenceException: Object reference not set to an instance of an object
MoreMountains.InventoryEngine.InventoryInputManager.OpenInventory () (at Assets/InventoryEngine/InventoryEngine/Scripts/Core/InventoryInputManager.cs:142)
Attached is the script of the object I'm referencing. I'm probably doing something wrong...
-
It's hard to debug without knowing more about the third party code.
It is successfully calling the method, but the method is looking for an MMEventManager that is null maybe...
I notice the OpenInventory method is protected so it might be more of an internal call that needs setup. I would check with the author of the library or check their API docs for the method you should call to open the inventory.
EDIT: In general you can use Invoke Method if the method has no parameters or a return value. If the method has parameters or return you should use Call Method. The action should automatically find the required parameters etc.
-
I'll check it out and I'll post the solution once I find it. 😊
Thanks Alex.
-
An update regarding this topic:
There was a problem with my current version of Unity (2018.19.9f2) For some reason the invoke method wasn't working. I just updated to Unity latest version (2018.3.0f2) and it works perfectly fine.
I can invoke the function and the inventory window opens.
-
Thanks for the update!