I am getting this weird error "PIE: Error: Blueprint Runtime Error: "Accessed None trying to read property Drone"

Hi ,

I have BP which I am calling from another one of my player character. The functionality is to switch between the player and a flyable drone BP. It was working perfectly all along the development and nothing in the logic is changed or any other change BUT suddenly start getting the error message
"PIE: Error: Blueprint Runtime Error: “Accessed None trying to read property Drone” when calling any function of the Drone BP.

I even created a new function just as a test to see if this error comes and yes it again causes the same error.

Can someone help me out here as of what went wrong when nothing changed in the BP.

This is where I am calling from the drone function:

And this the function of the drone BP

Will appreciate any help here, for sure there is something very small which I am not able to identify

Regards,

Ahsan

Where are you setting the drone reference?

If the reference actors is not set or later destroyed, then the reference variable “Drone” becomes invalid because it points to nowhere causing an error.

You can add an isValid node before calling anything on Drone if it can become empty.

Drone reference is set to Drone_BP. This was actually working , it is still working in the older project file but in the new project file, it is not working. I migrated to new project file.

Its UE 5.2

I have created another BP

Defined a function in it to print something

Calling it from my third person player which has metahuman in it

Its same error message even for any BP I create with any function defined in it

This seems to be problem in the Engine or something or what, I dont get it

Are you setting Drone_BP as an exposed variable and setting it once the actor is placed into the world or are you using “get actor of class” or getting actor with tag to set this?

It’s just an empty variable of type Drone until you actually set it’s contents

For debugging purpose I made another project as third person character template

Created BP_Drone of pawn type and referenced its print function in the third person BP

On pressing Z calling the print function by referencing the BP_Drone and calling its print function.

Same error even now, attached are the screen shots for all


This is from where I am calling the BP_Drone


Here I am setting up reference to the BP_Drone


Here is where I am defining a print function in the BP_Drone


And this is the error message again I am getting

So in the third person character, I am setting the “PrintRef” variable as type of Drone_BP

Is this referencing not correct ?

Listen, you are not setting the ref variable anywhere in the project. It is empty. It will always be none (nullptr). You need to load an asset and set that variable with the loaded asset.

You get a valid asset either by:

  • spawning it into the world
  • getting it from the world via “get actor of class” if it is there.
  • setting it via an exposed variable once dragged into the world (requires the other actor to exist in the world)

After that you have to get this collected actor and SET the drone variable.

Right now the variable is not a drone => it’s an empty space with a sign saying “put drone here”

1 Like

Working!

Thank you so much.

I do not get one point, in the earlier version of the same BP, it was working with out using the node “get actor by class”

Why it’s not working anymore.

Anyways, problem solved.

Thank you so much for your help

Perhaps the variable was exposed and set in the details panel of the actor once it was placed in the world.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.