Download

Inventory system for VR

I am following this tutorial series on how to create an Inventory system.

and if I add it to viewport it actually works.

0f2c4beee5d00166c9e36b1546a62c4afb8f547c.jpeg

In here you can see the main widget.

65134815f132b57df129213f0f9092b1390ad003.jpeg
2d2bdc57c83f1ea3fdd5fd7ec20fbe88241533b8.jpeg
859caa01ba3be4e8dfa153f0ab7622fad288e740.jpeg

I set up a widget and attached it to the left controller.
bbf0f89e4364f3f9b76a4ad2a350c7b87813f27b.jpeg

The only problem is this is what it looks like when you play.
6a48f3c5ecee2d72b4f546adeb9e743e009bd20f.jpeg

As you can see there are no slots. I’ve narrowed down the problem to this.
492f7fa5d9ea2bda8bcd7184f0e4f456d70c5abf.jpeg

Its off an event begin play. If I can somehow get that code to go to the widget instead of the add to view port I should be able to have a working inventory in VR. If anyone can figure out what I need to do I’ll be happy to upload a project with the finished inventory and share it with you.

3DWidget.png

I am assumed using 3D widget to display on VR, please check if the draw size is to small to draw all slot.

Ya there is more that enough draw size.

Plenty.JPG

Its this code which is referencing the two other widgets that is causing the problem.
492f7fa5d9ea2bda8bcd7184f0e4f456d70c5abf.jpeg

This is so Fing frustrating. Stuck on this for the last day and I can’t move on to something else until I figure this out. Surely someone must know how to add this to a 3d widget instead of add to viewport?

e32c84547df549a3b2e39021b26f7fa3e262800d.jpeg

did you ever find out???

In the end it wouldn’t work in the player pawn so I put the code in the BP_Inventory Blueprint in the end and set it to a reference of the 3dwidget. There is probably a much easier way of doing it. It’s an abandoned project but if I was trying now I’d probably see if casting to the widget would work. Maybe using a getallactors of class node but below is what I did at the time and it works.

Hi

I followed the same tutorial and am looking to achieve the same as you were in this project. I followed the last image you posted, but seem to be getting “Access None trying to read property Inventory”. Did you run into this problem or have any advise? Did you ever make your project available ?

Hope you can help !