Accessed None Trying to Read Property "ItemObject"

I am trying to make a multiplayer inventory system, and right now I am running into trouble when trying to drop an item from the inventory. I have everything SO CLOSE to working but there is just one issue. When trying to drop an item there is an error that says, Blueprint Runtime Error: "Accessed None trying to read property ItemObject". Blueprint: FirstPersonCharacter Function: Spawn Item from Character FPBP Graph: SpawnItemFromCharacterFPBP Node: SpawnActor inside of the message log.
Here is the whole message log:

When using break points and shtuff to figure out where things are going wrong. I can see (in the block code below) that I am actually getting the item that I am dropping just fine in the Inventory widget when casting to BP_Item_Object.
Inventory_Widget Drop Function Override:

My only issue is when I go to the custom event inside of the first person character (shown below) , the Item Object variable is indeed returning “none”. So that’s my issue. Why is this returning none when something is clearly being inputted to this variable?
Custom Event Inside Character BP:

It could be a couple of things. If ItemObject is being created or checked constantly, it might be none sometimes, or it might be none for a small instant.
You can use an isValid with branch to check, or sometimes a very small delay node will fix it.
I’ve also had times that I could not work it out, so I just kept programming and it went away eventually…

1 Like

I’ll try adding in some delays to see if it works.

Check this out:

This blueprint, upon pressing T, will spawn an actor if the input comes from the locally controlled player (which is probably true anyways, but just making extra sure).
Then, that actor is sent to the server.
After a 5-second delay, a string is printed, true if that object is valid, false if not.
If you press T on the server, it will display “true”. If you press T on a client, it will display “false”.

This leads me to believe that the Actor being spawned on the client does not exist on the server, therefore it is not valid. However, an actor being spawned on the server is valid on the server (obviously).

The way to fix this? Probably spawning your actor on the server and replicating it to clients. The original actor will be available on the server and you can do what you want with it.

I haven’t tried anything with servers yet. But we always seem to be trying to find work-arounds for things that you would think are easy…

I added a delay and had it run on the client. It actually drops the object now, but only for the client. I tried running an addional event for the server but can’t get it to work. Whever I change it to anything but run on client the function doesn’t want to work.

I think my last reply should indicate the broader issue you are facing… And to be honest, multiplayer is not easy to immediately pick up. It is easy once you know it but getting to that point takes a lot of work. I highly recommend going through the documentation and learning some best practices on how to avoid so many of the issues you will face. Then read it again, and again, and take notes. From experience there is no easy way out when it comes to networking.

1 Like

Yeah, it’s kinda stupid of me to try making a multiplayer game as my first real go around. But I have networking experience; just not in unreal. I am going to do some studying and try and figure this out. I’ll provide an answer when I find one. This documentation has already solved one of my other issues.

I’ve done some work on replication and from what I have figured out this does work. My one problem is my BP reference is no longer valid by the time it tries to spawn the item for all of the clients as well. (This issue was the original one I was trying to solve, but properly replicating has nothing to do with the issue anymore).

Video Explaining Issue:

Not A Solution:


This ends up just spawning two swords which neither of them can the other clients see.
I have also tried skipping spawning on the client and just spawning on the server and replicating. But then it just spawns nothing.


I did some validation checks and this particular spot is where the item object reference becomes invalid.

I finally did it. It was really simple. I also had to make sure that the BP_Item_Object itself was replicating properly inside of the BP by changing some of the replicating parameters.

Drop Item In FPBP:

Inside of Spawn Item for Clients:

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