3D widget does not work with inventory

I wanted to create a 3D inventory that could be used with a vr experience so i looked to the Inventory UI with UMG in the learn tab of unreal. unfortunately when I add the inventory to a 3D widget in a blueprint actor it stops working. Is there a way to fix this or is it just not possible to have a 3D inventory?

What do you mean it is broken? You can’t just add a widget to an actor in the world and expect it to work like it would with a widget in the viewport. How do you reference the widget? When it is a component of an actor in the world you need to go through a process to access the actual widget. Drag out the widget component → get user widget object → cast to “your widget class” → save output as a reference. Then you can begin to modify the variables within it.

ok, so I am trying what you suggested but i am not sure what you mean to save output as a reference. I have this so where would I go from here in order to get the 3D UI to display the same as the on screen UI? thank you for the help it is very appreciated.

I changed it to event begin play, added the reference and called it Game HUD. Am I now supposed to use the “get Game HUD” in the widget blueprint that has the inventory in it so it will match the on screen one and if so i’m not sure how i would go about doing this.

First, never use tick for something like this. Use event begin play. Second right click on the output pin of the cast node and promote to variable. Now you have a “reference” which can be pulled out in other blueprints with a “get”.

You could do it from any blueprint. What you need to do is cast to the actor BP that has the widget as a component. Then drag off the output pin of the cast and say “get Game HUD” this will return the variable that is a reference to the actual game HUD widget. Then you can modify the widget as you see fit just like you do for the viewpoint widget. Call functions, set variables, set image brush and icon etc.

So what I am trying to figure out is how you got the first inventory to work. If the first inventory works, you basically just need to re-wire it so that instead of “updating” the UMG viewport widget, it updates the UMG widget on an actor. Do you have screen shots of your functioning widget? I think it might be easier to modify from that.

Ok, relax haha I will download and figure this out for you.

I have been trying to figure this out and i’m still just stuck. Would it make sense to do this in the actual widget blueprint starting with the event construct to the cast? and what would I use as the object to make the cast work?

I’m literally just using the inventory UI with UMG project that I found in learn tab when you open epic games and are in the unreal engine tab. if you were to download that it would be exactly what i’m working with.

It works fine, it is just a pain in the a** to re-purpose for what you want. It is setup as a viewport widget, you can’t just drop it down on any actor. As I said before this is something you will have to “modify” to work on an actor in the world. I just did a quick run through with this. I duplicated the original widget, added it to an Actor and then re-wire all the stuff I could find to use my new widget which needs to be referenced the way I mentioned in my first post which is different from the widget being referenced in the viewport. And now it works, I didn’t go into the “action menu” stuff because it is seriously just about finding all the references to the viewport widget and creating the new reference to the actor widget. Here is a screen shot that show you it does work.

So if i’m understanding this correct i need to take this

and change every reference of this with this?

or am i missing something?

Correct! And you might have to grab new nodes for whatever is inside that widget although they should all have the same name. Mine weren’t connecting to the old ones like “inventory” (the actual inventory array variable within the widget). But yes, now you got the idea!

I’ve switched every reference i could find to my “UI”, but i’m still missing something. was I supposed to switch the cast to mycharacter to cast to the actorBP or am i supposed to switch something else that i missed?

All you did was rename a variable there. You didn’t REPLACE the references with your new widget actor. When I said you need to “rewire” and it was a pain in the a** I meant it haha You are taking a viewport widget and an entire inventory system set-up to utilize a viewport widget and you want to stick it onto an Actor in the world. Which can be done BUT requires you to create a reference to the “world actor” anytime you want to do anything with the inventory and from each blueprint you wish to modify the inventory. Accessing a viewport widget is fairly simply you can get a reference to it from “create widget” and save the output pin. Accessing a level actor isn’t that simple. This is usually where overlap events, hit events, event dispatchers and interfaces come into play. I was lazy and used “get all actors of class” to create the reference and went from there. Here are some screen shots of what I mean when I say “reference” and “re-wire” this entire system.

Hi Nebula,

had the same problem as the thread starter and your solution worked great!

Big big thank you!