playMaker

Author Topic: Keep state between scenes?  (Read 798 times)

myyokeisheavvy

  • Playmaker Newbie
  • *
  • Posts: 5
Keep state between scenes?
« on: April 30, 2020, 04:06:46 AM »
I'm doing a small adventure game where I have a few rooms inside of one building. The game starts with a dolly shot and fade in after the main menu. My problem is moving from room to room (each room is its own state) and when coming back to the main hub the fade in and dolly replaying. Is there a way to store that an FSM has finished between scenes?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Keep state between scenes?
« Reply #1 on: April 30, 2020, 05:12:21 AM »
hi.
you could for example save a int variable and when you start in main menu you can check that int (int switch) and target the room state

ch1ky3n

  • Full Member
  • ***
  • Posts: 208
Re: Keep state between scenes?
« Reply #2 on: May 01, 2020, 09:36:42 AM »
use bool variable ; isFirstTime = True

So your state will check if isFirstime = True then play the dolly camera and Set isFirstTime = False

so next time you get into the room. Since isFirstTime is now = false, then the dolly camera won't play