PlayerState has ReadOnly Score variable

I created a new BP extending PlayerState and tried adding a Score variable. That failed, because it already inherited one from PlayerState. However, Score, as well as PlayerName, are read only. Why is this?

1 Like

Also am confused by this. I’ve been doing searching but can’t find anything regarding how to use this.

This is completely nuts indeed. As it is now, it’s completely useless for Blueprints.

I am a little frustrated with this, and surely this is rather bad to have been not removed or not fixed or at least some explanation to this. It is a huge pain to not be able to use a variable called Score because a dud variable is already there and I would guess extra ‘tiny amount’ of stress on initial bandwidth seeing as it is replicated…

The playerName is readonly, because (depending on which online system you use) this is your network name, eg. the steam pseudonym. Since leaderboards are also implemented in the online system, I guess it’s also populated from there.

PS: If you ask me, they should not be readonly or they need a online system which let’s you edit it.

Not only it is useless in blueprints, but it is also useless in c++. There is at least a public function that allows you to change player name, no such thing for scores. It’s just ■■■■■■■ me off that I have to make my own class and make the same variable.

No, people think online services are super impotent and required, reality is way different. UE4 multiplayer implementation is made so server can work independently and don’t need any online service to run, those are just extra features, not to mention online services are mostly only social services.

No. 1 reason properties are read only is because just setting those varbales don’t execute any update code, to force higher level programmers to use different method properties are either protected in C++ or read only in blueprint, or there compatibility issues with blueprint workflow (probably due to fact it’s replicated?) and UE4 expect you to use C++ which is seems to be the case with Score.

In case of player name, it is as explayed above, it not about online service is to force you to call a function:

But for some reason it is not binded in to Blueprint

OnRep_Score is empty, so it doesn’t do anything to actually replicate the variable. Even if I wanted to override that and make it update myself there is no way I can do that in a derived class. It seems that someone just used a wrong protection level while writing this class.