Announcement

Collapse
No announcement yet.

How to get at game-global state?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    How to get at game-global state?

    I want a "time of day" variable that is available to all levels and entities/actors, and is retained between level loads.

    I created a variable on the Game blueprint, but I can't find a way to actually get at the Game blueprint's properties from other blueprints.

    What's the best way of keeping this kind of "global" state? Is there some way to get at properties of Game? (MyGame from the sample blueprints, for example.)

    #2
    Well, step one seems to be "use game state, not game mode."
    Game mode only runs on the server; game state can contain replicated variables that are available (using Get Game State) everywhere.
    It confused me a while because I couldn't find a menu item to get the "cast to my own game state class" but after saving and re-compiling everything and re-building the level, and re-opening the blueprint, that node showed up.

    Comment


      #3
      There's issues with the blueprint menus in 4.5 if you were having trouble finding your nodes. Usually turning off Context in the bp menu will show you missing nodes, though note it will fail to show you nodes that having Context on will show you.

      Comment

      Working...
      X