I created a reference to my player in a blueprint of a NPC to Bind the Event Dispatcher that is called when I press E’, but it didn’t work. Then I tried with collision sphere and when the collisio triggers it appear an error saying ‘Acessed none trying to read property etc etc’
Why?
Because that property is null.
Access None means the variable/pointer is empty.
And what do i do? This didn’t work.
I tried with 'Cast to [BP character] and it worked, but I don’t know why
What does the full error message say?
is “Alba” the source of the error? Can you show where it is defined?
It is possible that you try to bind the event before setting the variable properly, then that would return that type of error.
Hi @NekoEn,
Given it worked with a cast node, your original reference won’t be a nullptr. You will likely be using an Actor reference or some parent type on which the property you are trying to get doesn’t exist.
You could keep the Alba variable the same and just use the cast node which should work fine. Alternatively you can change the type of Alba to BP_Character (again, it’s probably some kind of parent Character or Actor class currently) so that when you call functions directly from the Alba reference it will have the correct property to use.
Thanks,
Hayden
This is the message error:
“Blueprint Runtime Error: “Accessed None trying to read (real) property Alba in BP_Daughter_C”. Node: Bind Event to On Follow Graph: EventGraph Function: Execute Ubergraph BP Daughter Blueprint: BP_Daughter”
I followed the same steps presented here Event Dispatchers and Delegates Quick Start Guide in Unreal Engine | Unreal Engine 5.6 Documentation | Epic Developer Community , the difference is that I used the BP of the player and the BP of an NPC. This is the full BP of the NPC
As I understand it, beginplay means nothing comes before it; so Alba has no value as mentioned above. Try the below. And, I imagine it goes without saying, but your NPC must be present in your level.
You can replace the cast with an overlap or AI sight event to get a player reference.
It worked dragging the character to the default value, although I don’t know why it keeps saying ‘None’
Thank you!
Yeah, the Cast node worked before, but it’s an college work and I need to know what i’m doing (don’t know at all) so I wanted to keep the ‘get’ node, it worked dragging the character to the Default Value.
Thank you!
Do you know a way to get the player reference with a manager blueprint (don’t know how to call it) and then change the value in the npc blueprint?
I’m not sure what you mean by manager, but if you mean a Blue Print Interface, there are many youtube videos about them. And, you can access information via a capsule or collision box overlap between actors and/or components, just make sure collision settings allow for overlap and overlap events.