Getting a variable from a different level

There are two ways you can achieve this goal.

  1. You can use the Save Game object in order to save settings and load them up whenever you need access.

  2. You can use the Game Instance to pass information across different stages of your game.

Both are valid ways that you can use to store your variables and load them as needed.

I have a customization screen where I choose the colour of my character. I want to then get this value and apply it to my character.

This is where the colour gets set

And when I get out of the customization level and into the main level I want to get ‘player colour’ and set it as my character colour.

This is my character:

I want to set the colour of the cube to ‘player colour’

I think I’m doing it right but when I get it to print the linear colour, no matter what it is always R = 0.00 G = 0.00 B = 0.00 A = 0.00.

Thats the customization screen widget -

This is the player -

Okay it works now but how would I go about changing the players colour to that? I was thinking there might be a way of changing the material colour.

You forgot to Save Game to Slot after you set the color. You only created a new save game object, assigned the value of the variable, but never saved it to a slot. So it never has a chance to load it, it will always create a new one and return you the default value of 0,0,0

That’s a different question all together, that deals with materials and parameters.

If you have questions regarding that, I suggest making a new question in Answer Hub.

Please mark this question as complete for tracking purposes by accepting the answer, so that others may find this.