Hey folks,
I’ve a little weird issue today that I can’t figure out how to solve.
I init a debug HUD on C key pressed, then store the constructed widget in a variable “HUDDebug”.
On a BP_Passiv_Base, I’ve a logic where on an overlap, my weapon is upgraded (that work correctly on server&client) and I update info on my debug HUD.
In this BP Passiv Base, I call an “UpdateValue” function of my WBP HUD Debug, with my HUDDebug variable through my cast of Player Char, this work fine on the server, but not on the client (Access None trying…).
I’ve checked, my HUD is correctly isntancied on each client. I can’t get why through this cast the get of my component works fine but not the get of the HUDDebug variable.
The reason for this is that you can’t call client RPCs on actors the client doesn’t own. Actors the client does own are usually: PlayerController, PlayerState, Character. More on ownership can be found here. Also, the multicast event that comes afterwards is wrong too. It’s clearly written there: “Replicated to all (if server)”, and supposedly you are on client, but in fact you aren’t. Again, unless you have a valid net owning connection, the client RPC is in fact going to run on server.
Another note, if that actor you are destroying is a replicated, server-spawned, then you should be destroying it on server, and it will be auto destroyed on clients too.
Read this a few times in case you missed it, and make sure you understand every single word.