Hello, I’ve setup a login system in blueprints for my game, and what it does is when someone logs in successfully it stores their username that they’ve typed in into a GameInstance blueprint.
They then get transferred to a different level, which will spawn a character for them to possess. This all works, but my question is, how do I now set variables per spawned character…
On event begin play for these spawned actors, I request the Username from the GameInstance blueprint and set it as Username, however… this replicates for every spawned character client-side.
For example I’ve set it up so that when you click on an actor it will print out the set username variable, but it doesnt matter on which character you click, you will always get your username in the printed string.
Even setting the username variable to replicated or repnotify doesn’t work…
I’ve tried to figure out how to do this four hours but I’m stuck and Im hoping someone here can help me because the AnswerHub seems to ignore my questions regarding replication.
Thanks in advance.
The username variable is applied to every instance of the spawned actor, I want to make it so that you only get your own name when clicking your own character… not someone elses…
Setting this variable to replicated or repNotify doesn’t seem to do the trick…
Okay so that sets the charactername for the TopDownCharacter initially, but my problem is this:
When client 1 then clicks on client 2’s TopDownCharacter he doesn’t get client 2’s version of the characterName variable from the TopDownCharacter… instead, he gets his own… (replicated/repNotify both don’t work)