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?
(comments are locked)
|
Your answer
Follow this question
Once you sign in you will be able to subscribe for any updates here
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.
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".
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.
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.
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?
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.
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.
Ok, relax haha I will download and figure this out for you.
Hi Nebula,
had the same problem as the thread starter and your solution worked great!
Big big thank you!