Action RPG Inventory System

OK, I think I found the problem.

For starters, I checked both the Inventory Manager Component and the Player Inventory Component on my Player Controller and they both were not NULL.

Next, I decided to replicate the Player Inventory variable and initialize it with a server RPC instead of what you showed in your screenshot above.

This removed the Accessed None errors on the server.

However, I still can’t pick up anything.

I think this is because the server doesn’t know where to look when doing the line trace. I was dealing with server/client line traces in another thread. Essentially, here, when you press E, you call the Server_OnActorUsed function, which is a server RPC which will then call OnActorUsed. OnActorUsed will then call GetUsableActor, which is where the line trace happens. So in the Get Usable Actor function it uses the Character Reference and uses that reference’s Follow Camera and Camera Boom to create the two vectors needed for the line trace. However, Follow Camera and Camera Boom aren’t replicated, so the server will have no idea where to start and end the line trace. In fact, I put a Print String right after the Is Valid check on the character reference on the Is Not Valid side and it printed a string on the server, meaning the character reference is NULL.

So I think to fix this, I’m going to have to make sure that Character Reference and Equipment Character Reference are both replicated and initialized with RPCs similar to PlayerInventory. And then I’m going to need to fix the Server Line Trace to use the proper location and rotation of the cameras, which will require either setting up replicated camera variables or just passing in the start and end trace vectors through the RPC.