Hi,
PrimalItem_Base Reference
So, this works in the Player Controller.
It displays our server rules, when you hit the tick key; which is okay. However, I want to have this widget display the server rules when you use an item in inventory.
So I created a child of PrimalItem_Base, it has an “Event Blueprint Used”, cool.
I tested this event with a print, and it fires when I click my note in the inventory, and then click use; so I’m trying to make this work like a book in inventory, that displays the rules when you use it.
But, I can’t call “Add to Viewport” from it (the PrimalItem_Base), as it tells me the function does not exist; scoping?
I am somewhat new to UE4 and trying to grasp the scoping and referencing, I’m struggling.
Well, since the above works, I thought if I could use an event dispatcher on the Primalitem_Base child I created, and have it fire on the Player Controller this world work.
PROBLEM: I can not to seem to make the PrimalItem_Base child that I created communicate with any other blueprint. I selected the PrimalItem_Base class to create a child from, because it has the event I need (Event Blueprint Used – which fires when you click the “Use” button in the ARK inventory menu, with the item selected).
I have read over the UE4 documentation on Blue Print Communication, but it seems the problem is that from the Player Controller, I cannot get a reference to this item. The item is a child of PrimalItem_Base, like I said, and I put it into the default inventory, of the PrimalInventory1 component of the Pawn.
So, I can click on the “ServerRules” item in game, click the use button and have it say, print test; so it works.
What I cannot do is have it display a widget, or dispatch an event to do this for me in another blueprint, because I cannot get a reference to it. Casting works between some blueprints, but what would I cast to the PrimalItem_Base child that I created?
Help.