Why my character can't execute a RPC On Server?
Basically, I have a GameMode which has the MainPlayerController as the PlayerControllerClass, as follows:
As you can see, there's no
Though the BP seems confusing, what it does is pretty simple: On BeginPlay, the Server spawns the character in a random location.
One important thing to note here is that I'm passing the MainPlayerController as the owner of the character. This is because I've read a lot about ownership and replication and seems only characters owned by clients (which are, per say, controllers) can run an RPC
My Character, which is Character_Main, has a function called Add Item To Inventory. This function basically executes when the player clicks on an item which is in range with the character.
Also, this Add Item To Inventory function is the one responsible to call an Event that'll only occur in the server. Contextually speaking, the server has to destroy the item from the "real world" and afterward transmit this information to all the other connected clients.
My misfortune here is that this event that only should be run on the server is not being called. This is how Add Item To Inventory is implemented:
Currently, I'm debugging the game running the server as a dedicated one instead of p2p. But if I unmark the option
THINGS TO KEEP IN MIND:
So, my final question is: what am I doing wrong?
Follow this question
Once you sign in you will be able to subscribe for any updates here