We’re using FSMs to control game play, and from time to time it is neccessary to pause the unity update loop (setting Time.timeScale to 0) so physics, animators etc.. stop. I’m now having the problem that I need to stop unity processing during our initialization, which – unfortunately 😉 – is performed by a NC FSM across multiple states. But when I set timeScale to 0, the FSM won’t run at all.
I looked into MonoManager and there is an early-out condition when timeScale is <= 0 – but I cannot find rationale for it. I’d be very happy if there would be a official way to let FSMs run all the time (just like UI animations for example), regardless of the configured timescale. For now it seems the only viable way would be to modify the MonoManager (which I really really really would rather not) and remove the early-out.
To be honest, ceasing functionality of graphs when timescale is 0, was a user request. At that time I didn’t think of any possible problems adding his request and thus I did, but I agree with you that it is not very rational.
I will remove the timescale check in the next version.
Thanks! If it conflicts with another feature (I can certainly see why it would be beneficial in some cases that the state machines are stopped when the game is basically paused), I could also live with the same approach unity tech did with the animation controller, where you can choose wether it should run off the scaled or unscaled time.
Right now, it hasn’t personally occurred to me to conflict with anything. An option like you suggest would indeed be nice, but because MonoManager is created in runtime there is not really a good place to put that option 🙂 (and I’d like to avoid to have it pre-created in the scene). Of course such an option could still exist and be set via scripting.
For the time being though, I’ve just removed the timeScale check for the next version, at least until someone needs it.
Thanks 🙂
Join us on Discord: https://discord.gg/97q2Rjh
Author
Posts
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic.
Login
Register
By registering on this website you agree to our Privacy Policy.