Are Static variables a thing? Or at least a way to store one version of a variable...

In my project I want to add a variable all players can access (doesn’t have to be multiplier, by players I also mean enemies) so they can check it.

At first I thought maybe add it as a variable of the level blueprint, but I couldn’t find a way to access the variables of the level blueprint from outside the blue print itself…

Then I decided it might also be optional to use static variable instead, but I couldn’t find a way to do it either…

I’m just really not sure anymore about what I can do.

Just to try and make my problem a bit more clear: I want to add a general variable that all other actors in the level can access - everyone can read it, and if someone changes it, it gets changed for everyone who would want to read it.

You can store the variable in GameMode or GameState:

What should I do in GameMode, GameState, and PlayerState?

1 Like

As noted Above GS or GM.

Players do not get a copy of the GM, so GS is typically the go to.

1 Like

You can add static functions to gamemode

1 Like