Blueprint Runtime Error: "Accessed None trying to read property PlayerUI"

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.

Here some Screenshots:

This is a Image of the BP_Controller Blueprint, if i click on the Errors it Guides me to the “Add to Viewport” Block.

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.

I thank you all and hope i can learn something :slight_smile:

Regards Daniel

Hey @hirny1991! Welcome to the forums!

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.

Hope this helps! Let us know how it goes.

Hello @Mind-Brain,
thanks for the Answer, i will test this as soon as possible and give Feedback.

regards Daniel

1 Like

I connected a “reference to self” Block to the “Owning Player” Pin and saved all.
The Problem is still the same as before.

regards Daniel

Hello! Welcome, Daniel! So… from what I understand… you just want to show your items names in screen when the character walk over them? :slight_smile:

Hello @Vinicius_Pires
yes this is correct.

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.

regards Daniel

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”. :slightly_smiling_face:

@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 ?

regards Daniel

So… you could simply call up your HUD within your Player BP (your character’s Blueprint):

Begin play > Create widget > Add to viewport.

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 :slight_smile: , if you say nodes, people will understand that they are the nodes of the blueprints, it will be better for undestanding.

@Vinicius_Pires
Oke let me try this with the Nodes :wink: (thanks for the Information)
Thank you for your Tips :slight_smile:

regards Daniel

1 Like

You’re welcome, my friend. Any doubts… hit me up.

@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.

I added you a Screenshot:

This is the Eventgraph of my “W_PlayerUI” here it defines if the Text is hidden or not, eventually it helps.

If i want to move the functionality of the “W_PlayerUI” i need to move all Variables, Functions and Notes to the “BP_Herochar” right?

Thanks for your patience with a beginner.

regards Daniel

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.

Thank you for your nice Help :slight_smile:

regards Daniel

Of course, don’t worry. Could you tell me more or less in general what your main idea would be? :slight_smile: 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?

I hope the Informations are Detailed enough.

regards Daniel

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 :slight_smile:.
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.

regards Daniel

1 Like

@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.

If you need more Info i will add it.

Regards Daniel

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:

2: Create a “Master item BP”. Go to its components and create a widget component:

3: inside the Master item BP event graph, create this simple code:

4: Then, create an sphere collision to detect the player:
Step 4

5: Set Begin and End overlap with this simple other code:

And that’s it! you will have this nice interaction independent of how many items are close to your character:

Any doubts just let me know! I really hope this helps you! :slight_smile: