Hello,
my Name is Daniel and im relative new to UE5.
Actually i have an Error that says:
Blueprint Runtime Error: “Accessed None trying to read property PlayerUI”. Node: Add to Viewport Graph: EventGraph Function: Execute Ubergraph BP Controller Blueprint: BP_Controller
The Error comes up when i close/stop the Game.
The Game itself run without Problems.
I searched for the Problem in Google and the Threads here but i cant find whats the Problem.
If i see this correct, the Error want to say me that UE5 received the Value “None” when try to access the PlayerUI so my Idea was to give a Default Value but this doesnt worked.
And Here is the Variable “Player UI” it points to the “W_Player_UI” Block which at the Point is just a Border with a Textbox th Display Items when Walk over them.
I hope this Forum can help me to fix this Error, and eventually describe what i can do to not run in this Error later.
If more Infos or Screenshots are needed just say it and i will do it.
First thing I would do is get something in “Owning Player.” I don’t remember off the top of my head what it accepts- if it’s a player controller input, use Self since it’s on a Player Controller.
The other thing would be to make sure every part of that widget is saved.
The Error seems not to break some Blocks or anything else.
My only Problem is to solve the Error, the Text is Displayed with the right Name when i walk over an Item so this works fine.
And to be clear, where is this code located? It’s a Player BP, Level BP, Controller BP?
Because, you would just need to remove this “Get player controller”, in my opinion it seems not required, if you are just calling your player’s HUD. You wouldn’t need to validate the controller if you just want to create a widget. This could be the problem with your “Accessed none”.
@Vinicius_Pires
The Screenshot is a Controller BP.
But if i remove the Get Player Controller Block, do “Enemies” (not jet in the Game) trigger the UI Event or not ?
And to get direct references from your player, you can use the node: “Get player character” which will look for the current player index used, it works well.
Need help with the system for showing the names of items when the player passes over them?
One more question to help you:
Is your game in first or third person?
And just one tip with all due respect: “Blocks” you meant the nodes , if you say nodes, people will understand that they are the nodes of the blueprints, it will be better for undestanding.
@Vinicius_Pires
So Hello again.
I tested your Solution in my “BP_Herochar” BP which inherits from my “BP_Basic_Character”, in the “BP_Basic_Character” BP is nothing at the time but i planed to use it for several Characters or eventualy Enemies.
But i cant eliminate the Error, additional i now cant see the “Popup” Text if i walk over a Item, i think i forgot a Variable or something but Unreal Engine says nothing about that so i cant verify this.
Sorry for the late, i was very busy in those days.
So… you want to already create classes and use them in the future. I never used a controller BP as a class. I would recommend you to first create your player first, learning how to do and then, creating the enemys and other things. I can help you with other things for now. Try to do a simple interaction system to display your items names. I can help you with that, it’s very simple really.
@Vinicius_Pires
Oke give me a few Days to start with a new clear Project.
I will try to make an Item, a Character and the Text.
Than you can say me detailed what i can make better, i hope i can learn a bit from you.
Of course, don’t worry. Could you tell me more or less in general what your main idea would be? Depending of what would be, you don’t need to start a clean project.
Hello @Vinicius_Pires
So now i have created a new Project with a Character that can be move and look, and some Assets for Items.
I tried it myself to create the UI Message again but i think i have a Problem with understanding this correct.
Can you write a few Words of what i need to create a UI Message?
I tried it with a Sword(SkeletonMesh) and give them a Hitbox.
Then i tried to Trigger the Hitbox of the Sword when my Character walks over it.
I used the Print Note to verify the event is Triggered.
Now i tried to create the UI Widget on Gamestart(Character BP) but at these point im stuck, because at first try the same Error Message as before pops up, in the following tries the Error doesnt apper but it seems the Trigger didnt work right.
I deleted the UI Widget as well as the Sword to hold my Project clean so i can try your Ideas without anything that can crash.
Is the Sceleton Mesh the right for the Sword or do i need a Static Mesh?
Is the Character BP the right place to add the UI Widget?
Well… as far as i understood… you want to make a simple interaction with your items. You want to display their name and some other good stuff later on. How about start with this:
I hope this helps for now. By the way… you didn’t said if your game would be in third or first person when i asked .
If the video don’t help, hit me up and we will find a solution for you.
@Vinicius_Pires
thanks for the Video i will try it.
Oh Sorry i forgot this, at the Time it is Third Person but i play a bit with the Camera Positioning and Options because at the moment my understanding is very low.
Thank you very much, i reply when i tried the Video.
@Vinicius_Pires
So Hello again,
i have successfully created a Cube with a Hitbox, when i run over it the Text displays and when i run away from it the Text disapears.
I also created a Interface and tried to let Display the Name of the Cube instead of a predefined Text but at the Moment i wasnt able to realize this.
The Screenshot shows my “BP_Basepickup” Blueprint eventually i can it make easier?
In the “W_PickupText” Widget i created a “Return Note” and connected the Variable “PickupText0” to it but this is a predefined Variable so have you a Idea to grab the Name of the Cube to Display.
1: First create an widget called (You decide) but me, i like to create and "name/fucntion widget.
Set those simple components inside the widget to create a cool asthetic: