Download

Cannot Update HUD On Client Side

I am a bit confused as to why my HUD is only updating on the server side, as opposed to the client side.
Right now I have a working inventory system but the textures won’t update on the client side.

img 1.png

I have the texture updating the HUD every time an item is placed in the inventory.

img3.png
img2.png

But this only shows on the server’s inventory, not the players. Any suggestions/help/ideas would be awesome!

The reason why is because your only getting the controller of player at index 0. You need to to “get controller” rather than “get player controller”.

This doesn’t work at all. I cannot call a “GetHud” unless I call it on PlayerController as opposed to Controller.

Oops sorry. I forget its literally a controller. Try “Get Owning Player Controller”

Tried this, and no go either :frowning:
img4.png

If that is the case you’ll need to move all the stuff you want to update the hud to a custom player controller class so the gethud references itself. :confused:

I’m already using a custom player controller :frowning:
This is a huge bummer.

I even tried this and it still is a no go…including my custom player controller.

Still ONLY works on server, never client.

I’m thinking it has to do with the fact that event draw receive hud is run client side only and so therefor won’t update by server side actions.

But I just cannot figure it out.

The reason why it’s not work as I’ve all ready said is the controller in which your getting, “Index 0”. Regardless of who runs the command it will always try to get the very first controller. If your the second person to join the game your controller would be 1. If your the 10th person to join your controller would be 9.

Having said that I think I may have got a work around for you. Place a variable in your player controller that’s a player controller and set it to self. Then inside your character “Get Controller” and then cast to your player controller, from that you can get your variable you set which should be the reference to self. :slight_smile:

PlayerControllerReferenceSelf.png

PlayerControllerReferenceSelf2.png

Wow thanks a million, I’ll give this a try once I’m done rebuilding the source. I always thought that indexes were strictly for local multiplayer games only, as in sharing the same screen. At least that is what I’ve read up online. But I’ll give this a shot, thanks again.

I think you are right with the index only being local players, but you have to remember that your testing both the client and the server on the same machine, so the client is probably being given and index of 1. The screenshots I posted should hopefully resolve the issue your having.