Jump to content

The "Ah Ha!" Moments.


Recommended Posts

  So I'm realizing today that I need to make the primary state machine of our system a system that exists outside of the primary scenes. It hit me like a ton of bricks when I was clicking on one of my main menu buttons and...nothing was happening. Well shoot, I thought, that's definitely unexpected! I've been using this system for years, how could it be failing now?

  Well, when a tree falls in the wood and nobody has registered a listener, does it raise an event? The answer, at least in my system, is no. This isn't an insurmountable problem. What I can do tomorrow is create a class that I add to my fresh scenes, this will check to see if we've instantiated the state machine yet (and placed it in the do not destroy scene). Once this has happened we'll have our system setup and ready to rock for all other places.

  This is a bit different from a singleton in that we won't actually have any static references to it. This is simply a system that exists in the ether and communicates back and forth with the rest of our game world through events and our scriptable objects. This is an exciting moment for me because it gives me a very direct thing to solve and given how fatigued I've been lately that'll be a welcome adventure! Once that is done we'll move onto the next game action I need which is spawning the player at a particular location and rotation. We'll need this for the introduction sequence.

Link to comment
Share on other sites

×
×
  • Create New...