Save variables (random color) to GameState

Hi everyone. I’m a starter, and I can’t find how to create a set node with multiple variables.

I’m trying to make replications work on my dedicated server by setting a random color for every character connected.
In order to do so, i’m trying to call a server event that will generate a random color and save it in gamestate so I can call a multicast event on the gamestate and send my pawn to it. Here’s the blueprint that inspires me.

My issue is that I can’t figure out how to create the “set” node that can receive my 3 random floats and target my GameState. Does anyone know how can I manage to do this ?

Thank you !

Right Click the input pin and press Split. You can do that with any compound variable.

And as for random color, I’ve had my share of experiments with it, and it does not work well. Some colors will be bright Red/Green/Blue/Purple/Yellow/White, and some dirty gray-ish non-distinct ones.

Unless there can be dozens of players, I’d recommend having a predefined array of colors, like 10 or 15 of them, and assign them randomly. Visually it will be better.

Thank you for your answer ! I think i’m doing something wrong. Now i’m stuck here.

When I right click in the set input pin, I only see "Select, “Break”, “Jump”, “Straighten”, “Promote” and “Watch this value”, but no “Split”. And even if I could, how can I add my GameState Object Reference input ? I think i’m using the wrong “Set” node, but I don’t understand which one i have to use in order to split my input pin with 3 input, and also have a GameState Object Reference input pin.

As for random color, I completely agree with your advice :). But right know i’m only testing if I can manage to make replication works on my dedicated server. Once done, I’ll have several materials to apply to my meshes.

Thank you again for your answer !

You’re setting a float variable, and you need a Linear Color variable or a Vector3 variable if you don’t need the Alpha channel. Just change the New Var 1 type to Vector or Linear Color, and then the option to Split will be there.

Edit: as for your game state: pull the As GS VR input and then search for Set your variable name. Thus you’ll be able to access the game state variable.

Have you created the variable in your GS VR blueprint?

Glad to help!

Oh nice ! I didn’t think that a Linear Color variable could split automatically into 4 floats, thank you !

But I still have my issue for GS_VR input pin. I can’t manage to pull it into the same Set node like in the blueprint I provided in my first post. There is no target node, and when I pull the As GS_VR input, I can’t find anything typing “Set”. I can only promote it to variable.

Thank you ! My variable in my GS_VR blueprint had an other name, my bad. Thank you very much for your help and your time !