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