I am currently working on a multiplayer game and I am having difficulties on assigning values on variables for each clients. Originally I looped through available clients character from HUD then assigned the calculated the value but I decided to do it inside character blueprint's instead.

I don't know why only first clients gets the calculated values but the other client still having the default value.

This is the initial value that I assigned from inside Character C++

MaxHealth = 500;
Health = MaxHealth;

This is how I assigned the value from the Blueprint.

Set Initial Attributes is where I calculated the Health value based on player's Strength value etc and the reason I'm doing this is because I am planning to retrieve the stats from the datatable in the future. But I don't know why it becomes like this instead.

This is the correct final value that supposedly assigned on both clients. First Client

But only first client gets the correct value, not second client. Second Client

I don't want to use loop to search the player characters' inside player character's blueprint and assigned the value because I don't think it's a wise move so I am looking for a better alternative if any. Thanks!


So I ended up calculate all the values inside the C++ instead and I'm not sure why I can't do it in the blueprints. From the log I gathered the values are updating correctly even when I'm still declaring it from blueprint. It's probably because Client 2 is basically not owned by ThirdPersonCharacter_C_0 but ThirdPersonCharacter_C_1 so that's probably why I can't see it from the dedicated server. I probably wrong though.

enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.