No announcement yet.

Why does PlayerController BeginPlay fire before GameState BeginPlay?

  • Filter
  • Time
  • Show
Clear All
new posts

    Why does PlayerController BeginPlay fire before GameState BeginPlay?

    I just noticed this in my project. The constructors are firing as you'd expect. GameState first, then PlayerController. But then the PlayerController BeginPlay event fires before the GameState BeginPlay. This does not make sense to me. Can someone help me wrap my head around the process?

    In my project I need the PlayerController to load some values from the GameState at the start of the game. The GameState is setting these values in it's BeginPlay (I cannot set them in the constructor). It looks like the PlayerController BeginPlay is not the correct place to do this. Any thoughts on how to make this happen? As a workaround I can put a 1 second delay in the PC BeginPlay. It works, but it is such a heavy handed hack. I really don't want to do that.


    I've also wondered on the process in witch BP load. As far as i know game state and player state are one of the last to load. If you want to keep values try the game instances. That BP is always present no matter what level you load up. I keep alot of variables that I need in there instead of say getting save game constantly.