Inactivity starts Demo mode

Hello All,

I am working on a project where I am taking a building model form Lightwave and loading it into Unity to use the game engine to show off the building to try and get people interested in giving to the campaign.

My thought currently is I'd like to have some way to see if "game" is inactive and if so it loads a "demo" level.

The game is like a FPS style where they can go and move through the building. And the demo would be a continuos 360 view of the exterior of the building.

I am very new to the unity engine, if anyone could point me in a direction to look into or give me an insight on how I might accomplish this , it would be greatly appreciated.

Thanks in advance!

I guess the easiest approach for this kind of thing would be keeping a timestamp variable in some "manager object" that also handles your two states ("interactive mode" vs. "demo mode").

You controller objects (any objects used for user-activities like moving, looking and so on) could then set this timestamp to the current time whenever an action occurs. Like:

  • user moves (in any direction)
  • user looks around
  • any other actions I'm not aware of ;-)

Then, in a coroutine (see also the different syntax for coroutines in C#, if you're using that language) in your manager object, you could check every couple of seconds for the difference between the current time (Time.time) and your timestamp and if that exceeds your "idle time", switch the mode.

On touching any key, you controller object could then switch back to the interactive mode (or you could have a button for that ... whatever fits your needs).