How can I make a hopbar style inventory?

Hello, How could I make a inventory that’s just like, 9 base slots? Something like Don’t Starve or Starveio.

Hey there @SSneakythief! So generally you will mostly find resources on how to make a full inventory system and a hotbar, not so much just a hotbar as inventory. However, you can still use these tutorials to just make the inventory the hotbar, however you’d need to change the tutorials up a bit. I usually recommend following a full inventory tutorial then once you understand how to change it, cut it down to just the hotbar.

Disclaimer: One or more of these links are unaffiliated with Epic Games. Epic Games is not liable for anything that may occur outside of this Unreal Engine domain. Please exercise your best judgment when following links outside of the forums.

Here’s a series by Ryan Laley that goes over a basic inventory system and hotbar:

1 Like

It was going smoothly untill I got to the end of the non debug part of part 5, and i’m getting the Error: “Blueprint Runtime Error: “Accessed None trying to read property K2Node_Event_PlayerCharacter”. Node: Branch Graph: IsValid Function: Execute Ubergraph Item Data Comp Blueprint: ItemDataComp”.
I’m unsure if doing the debug portion of the video will resolve this issue.

It sounds like there’s a node that isn’t setting the PlayerCharacter reference before it’s trying to be accessed, or you’re accessing it without a PlayerCharacter. Could you place a breakpoint on the locations you use it and check it then?

By all means I believe I’ve followed it correctly

That part looks good, for everyone implementing that interface, do all of the pass player characters after the character has spawned?

Just checked to see if it’d work in multiplayer, no dice

do you mean that i should try to get a count of the players somewhere along the line?

Ahhh yeah, multiplayer wise you have to change a solid chunk of this, but the basics of the script is still there. With multiplayer you’ll need to convert everything dealing with the handling of the items on the server side instead of letting the client handle it. I can find a network replicated example instead!

All players have their own PlayerID that you can set when you create an online player (or is set on it’s own if you don’t manually handle new players). You can get that from the PlayerState.

Disclaimer: One or more of these links are unaffiliated with Epic Games. Epic Games is not liable for anything that may occur outside of this Unreal Engine domain. Please exercise your best judgment when following links outside of the forums.

I think i understand how to fix the error, and its (i think) caused by the item being preplaced in the world.
I’ll try making item sources (ex trees, or uh, a full on test source) which spawn in the item and see if that fixes it.