Hi Everyone, I’m gonna try not being too confusing about this, I’m kinda new to unreal, and I’m following a tutorial on a third person action game. When setting the HUD for the player, the tutorial does the following
The thing is in that GET (only a copy) array thing. He grabs the integer node and brings a node literally called, DEFAULT, but when I look for it it doesn’t appear anywhere, the person in the tutorial is using UE4 so I’m not sure if the node is no longer available, or changed names, I’m just really confused on this bcs I can’t find it
Thank you so much for answering! I’d love to follow a different tutorial but so far it’s the only one on youtube with the specific mechanics I wanted to build. But to go straight to be point, this code is a blueprint for the player HUD, so far it only shows a couple progress bars:
It works well while the game is running, but once I close it it gives me this message (Sorry since I’m new I can only attach 1 image):
Blueprint Runtime Error: “Accessed None trying to read property CallFunc_Array_Get_Item”. Node: Create Widget Graph: EventGraph Function: Execute Ubergraph BP Player HUD Blueprint: BP_Player_HUD
Which I assume directly refers to that blueprint not correctly connected. and Since I still don’t have a full grasp of how the logic works it makes it difficult for me to figure it out. If you have an alternative solution I would appreciate it a lot, thanks again!
You can never get access to another Player or its HUD, if you need values from them you’d use the PlayerState or PlayerPawn.
but you havent told us what the progress bars represent, assuming its something like health then the Widget can just use GetOwningPlayer and find access to the variables from there
Sorry, I believe I’m being terrible at explaining what I mean lol, so basically this code you’re looking at is supposed to be the player HUD blueprint, I ended up deleting it since it just creates that error message I mentioned before.
So I created a Widget where I have 2 progress bars, set size and all the stuff, and they have bindings. This widget only contains the 2 bars at the moment.
Then I created a separate widget named Player_UI which contains the widget I mentioned before and the code previously shown. I assume the second widget is the one that will eventually contain other UI elements and that’s why I created it.
From my very narrow understanding I see this code is only to be able to display the widget elements on the screen.
The guy on the tutorial doesn’t explain why he does some of the things he does, and I’ve had to figure out solutions on my own before, but it’s the only tutorial talking about the specific type of game I’m trying to make.
And the Player UI Blueprint has this code. but no idea why it is.
Also before doing that code the tutorial tells me to create a variable of type HUD named Player_UI_HUD.
I can only upload 1 image at the time, so I’ll reply with the full blueprint and hopefully you can tell me where it went wrong.
That’s the issue, the Players array was not previously created, and this is a single player game so there’s no “need” in my understanding to have an array for them, I’m just following along until I stumble into a wall and try to solve it if it’s not provided in the youtube videos. It’s REALLY cool when I find solutions or I figure them out BUT very frustrating in cases like this one where I fail to ask the right questions lol.
Thank you for responding, I tried to find solutions to it but in the end this IS the best solution, there’s a lot of issues in this code and I decided to use another tutorial I found, and it’s been going waaay better already.